Skip to content

Commit

Permalink
Add selectMayUndo/Redo.
Browse files Browse the repository at this point in the history
Part of #65.
  • Loading branch information
jkomoros committed Sep 20, 2023
1 parent c1eafd4 commit e97c629
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ import {
} from './util.js';

import {
currentVersion
currentVersion,
mayRedo,
mayUndo
} from './undoable.js';

export const selectPage = (state : RootState) => state.app ? state.app.page : '';
Expand All @@ -46,6 +48,8 @@ export const selectCurrentSeedID = (state : RootState) => state.data ? state.dat
export const selectPackets = (state : RootState) => state.data ? currentVersion(state.data.packets) : {};
export const selectRemotePackets = (state : RootState) => state.data ? state.data.remotePackets : {};
export const selectEnvironmentData = (state : RootState) => state.data ? state.data.environment : {};
export const selectMayUndo = (state : RootState) => state.data ? mayUndo(state.data.packets) : false;
export const selectMayRedo = (state : RootState) => state.data ? mayRedo(state.data.packets) : false;

export const selectDialogOpen = (state : RootState) => state.dialog ? state.dialog.open : false;
export const selectDialogKind = (state : RootState) => state.dialog ? state.dialog.kind : '';
Expand Down

0 comments on commit e97c629

Please sign in to comment.