yaseenkadir / etchedjournal

An encrypted journal where entries are etched in stone.
Apache License 2.0
0 stars 0 forks source link

GH-149 Updating url after creating entry #170

Closed yaseenkadir closed 5 years ago

yaseenkadir commented 5 years ago

Fixes #149.

Something interesting about this change.

Have to replace state instead of adding. This editor is called by visiting /entries/new When the Etch is created we want to replace the URL instead of pushing a new one to the state. If the user navigates back they should go back to the entry list. If we added a state it may seem confusing if they navigate backwards. Consider,

  1. User opens entry list
  2. Creates a new entry by opening /entries/new, default title is 12/05/2019
  3. User creates a few etches
  4. Entry is created and we add URL /entries/A4nJpaSAAb0 to the state
  5. User navigates backwards and it creates a new entry with title 12/05/2019. It may seem like their etches were lost by navigating backwards.