Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync tabs #3

Open
OldStarchy opened this issue Jul 24, 2024 · 0 comments
Open

Sync tabs #3

OldStarchy opened this issue Jul 24, 2024 · 0 comments

Comments

@OldStarchy
Copy link
Owner

Version: b345ae1

The current "Whats New" section says

Opening this app in multiple tabs will have unpredictable results!

This is because every tab autosaves to the same location, so whichever one saves last is the one that sticks.

There's a storage event on the window specifically designed for this scenario. By reloading from save on this event we can at least sync the windows, however it will likely push a lot of noise into the undo stack if you do this frequently.

When a save is detected from another tab

  1. automatically load that save (there should be no chance of data loss since both tabs would have started with the same save
  2. ignore it (current behavior)
  3. Popup warning the user the first time, and give them the option to load the save or ignore it
  4. Also give users the option to disable autosave and use the beforeunload to warn users of any unsaved changes when they try to leave the page. Note that this is not reliable on mobile (the primary deploy target (see mdn)) so visiblityChange should be explored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant