Skip to content

Commit

Permalink
Make sure that undo/redo verify that a valid seed/packet is selected.
Browse files Browse the repository at this point in the history
Before, if you undid a create_packet or _seed action you might get a non-existent seed/packet.

Part of #6. Part of #65.
  • Loading branch information
jkomoros committed Sep 23, 2023
1 parent 298fafd commit fa7283a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/reducers/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,15 +712,15 @@ const data = (state : DataState = INITIAL_STATE, action : SomeAction) : DataStat
case DELETE_PROPERTY:
return modifyCurrentSeedProperty(state, action.path, DELETE_SENTINEL);
case UNDO:
return {
return ensureValidPacketAndSeed({
...state,
versioned: undo(state.versioned)
};
});
case REDO:
return {
return ensureValidPacketAndSeed({
...state,
versioned: redo(state.versioned)
};
});
default:
return state;
}
Expand Down

0 comments on commit fa7283a

Please sign in to comment.