maryvilledev / codesplainUI

Web app for breaking down and annotating Python 3 source code.
https://www.codesplain.io
GNU General Public License v3.0
2 stars 2 forks source link

Active Annotations aren't discarded when navigating away from a page #379

Closed thebho closed 7 years ago

thebho commented 7 years ago

Expected Behavior

If I am editing or viewing an Annotation and I click the Codesplain home button, the annotations should be discarded

Current Behavior

The "edit-mode" or "view-mode" stays with the current annotation until I refresh the page

Steps to Reproduce (for bugs)

  1. Create a new snippet
  2. Lock the snippet
  3. Add an annotation, don't save
  4. Click Codesplain to navigate home
  5. Discard unsaved changes

This is happening in Dev, but WAI in Prod

dane-johnson commented 7 years ago

Likely related to upgrading react-router

thebho commented 7 years ago

In prod it ask Are you sure you want to reload and in dev it asks discard unsaved changes When did we make that change?

dane-johnson commented 7 years ago

https://github.com/maryvilledev/codesplainUI/commit/748f5285ce31cfec1051be5eccaa4643dfa87554

dane-johnson commented 7 years ago

I think the difference is that before, clicking navigating home did a full redirect, now I think it just changes the app state without doing a server call.