Skip to content

Log out clears localStorage #1154

Open
Open
@danhalson

Description

@danhalson

Problems

  1. If you make a change with the editor, log in via the global nav, your changes will be preserved. However if you don't save the change, and log out, localStorage is cleared, and you will end up losing your changes.
  2. There's also an existing issue, where if you work on something locally don't login, navigate elsewhere and then come back to the editor you'll be presented with the splash screen, which implies you'll be starting a blank project, however you will still see the code you worked on previously.

Potential solutions

Not clearing local storage is simple to resolve by altering the GlobalNav::onLogOut function, which is currently clearing the localStorage entirely, however we only want this to happen with the starter projects, not with others as that would cause problems (i.e. direct links). We also need to ensure it still clears the authKey, the location, and possibly schoolOnboarding.

There is a potential signposting issue if we do this, since logout drops you on the splash screen, where the buttons currently imply you're creating a new project not continuing with an existing one. So we may need to make a design change. Adding a 'Continue your previous session...' button (with better wording) could be a solution here solving both problems above.

Additionally a reminder if you log out without saving your project, could be beneficial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions