Skip to content

Commit

Permalink
Merge pull request #147 from Team-40-IDATT2003/146-fix-transactions-p…
Browse files Browse the repository at this point in the history
…age-bug

Fix: Fix transactions page bug
  • Loading branch information
etsorens authored May 26, 2026
2 parents faf6c63 + 2e2a8c6 commit 4310a27
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ public enum EventType implements EventChannel {
* <p>Published by the {@link edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameController}.
* Handled by the {@link edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.quit.QuitDialogController}.</p>
* */
SHOW_QUIT_OPTIONS;
SHOW_QUIT_OPTIONS,

/**
* Event for refreshing the transaction list.
*
* <p>Published by the {@link edu.ntnu.idi.idatt2003.g40.mappe.view.ingame.InGameController}.
* Handled by the {@link edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.transactions.TransactionsController}</p>
* */
REFRESH_TRANSACTION_LIST;

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public <T> void handleEvent(final EventData<T> data) {
}
} else {
getViewElement().getTopBarView().setQuitText("Back");
if (data.data() == WidgetEnum.TRANSACTIONS) {
EventData<Boolean> eventData =
new EventData<>(EventType.REFRESH_TRANSACTION_LIST, true);
invoke(eventData);
}
}
activeWidget = (WidgetEnum) data.data();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public TransactionsController(final TransactionsView viewElement,
this.transactionArchive = transactionArchive;
super(viewElement, eventManager);
eventManager.addSubscriber(this, EventType.STATE_RESET);
eventManager.addSubscriber(this, EventType.REFRESH_TRANSACTION_LIST);
getViewElement().clearCards();
}

@Override
protected void initInteractions() {


getViewElement().getWeekSelectBox().setOnAction(event -> {
try {
Integer selectedWeek = Integer.parseInt(getViewElement().getWeekSelectBox().getValue());
Expand Down

0 comments on commit 4310a27

Please sign in to comment.