Skip to content

Commit

Permalink
Fix forward button behaviour and show results panel when moving throu…
Browse files Browse the repository at this point in the history
…gh history
  • Loading branch information
rogup committed May 10, 2024
1 parent d048384 commit 94e6249
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/map-app/app/presenter/sidebar/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BasePresenter }from '../base';
import { BaseSidebarView } from '../../view/sidebar/base';
import { SidebarPresenter } from '../sidebar';
import { Initiative } from '../../model/initiative';
import { canDisplayExpandedSidebar } from '../../../utils';

export interface NavigationCallback {
disabled: boolean;
Expand All @@ -21,8 +22,12 @@ export abstract class BaseSidebarPresenter extends BasePresenter {
* If the sidebar wants to do something more than to get its view to refresh when the history
* buttons have been used, then it should override this definition with its own.
*/
historyButtonsUsed(): void {
historyButtonsUsed(): void {
this.view.refresh(false);

// Show the results pane again, since there have been changes
if (canDisplayExpandedSidebar()) // on smaller screens, wait until user clicks Apply Filters
EventBus.Sidebar.showInitiativeList.pub();
}

deselectInitiatives(): void {
Expand Down
5 changes: 4 additions & 1 deletion src/map-app/undo-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export class WalkableStack1<T> {
assert(this.storage.length > this.index, "storage should always have the initial state element");

this.index += 1;
this.storage[this.index] = obj; // sets storage.length to index+1
this.storage[this.index] = obj;

// remove later items from the stack
this.storage.length = this.index + 1;
}

// Get the current item in the stack
Expand Down

0 comments on commit 94e6249

Please sign in to comment.