Skip to content

Fix: Fix transactions page bug #147

Merged
merged 1 commit into from
May 26, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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