Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made back instant #142

Merged
merged 6 commits into from Nov 27, 2023
Merged

Made back instant #142

merged 6 commits into from Nov 27, 2023

Conversation

awesominat
Copy link
Owner

closes #138

essentially, the price for every stock owned was fetched upon dashboard execution every time.
now, it will always use the last seen price of the stock and will only query to get the up-to-date prices when the refresh button is called

@@ -31,7 +31,7 @@ public void execute() {

Transaction transaction = new TopupTransaction(curBalance + amountToAdd, new PricePoint(LocalDate.now(), curBalance));

super.addToHistory(userHistory, "Stonks App", user, curBalance + amountToAdd, curBalance, transaction);
super.addToHistory(userHistory, "Stonks App", curBalance, transaction);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we adding to history on reset? I was under the impression that a reset clears everything, including resetting current balance to 10000, removing all owned stocks and clearing history?

src/main/java/view/DashboardView.java Show resolved Hide resolved
@gursi26
Copy link
Collaborator

gursi26 commented Nov 27, 2023

Also, could you resolve the merge conflicts?

@gursi26 gursi26 merged commit dd53882 into main Nov 27, 2023
2 checks passed
@gursi26 gursi26 deleted the made-back-instant branch November 27, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time taken to load dashboard increases with an increase in number of different stocks owned
3 participants