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

WIP Auto Save #2135

Open
wants to merge 1 commit into
base: dev/34-bismuth
Choose a base branch
from

Conversation

Viggie1
Copy link

@Viggie1 Viggie1 commented Jul 3, 2024

This PR allows for auto saving the editor whilst a user is working on it. The way this works is that there is an interval set for every minute that compares the saved JSON to the page's current JSON, if different than it saves the current JSON into local storage. If editor is still not saved after the user refreshes the client, then the client will pop up with a modal asking if the user would like to overwrite their changes, to which they can either confirm or deny. Additionally, this PR implements a "Last saved Xm ago" text in the file toolbar after the user saves, indicating to the user that it has been X amount of time since they have saved the module.
The reasons for this PR being a WIP are:
1.) Testing was not complete
2.) A browser alert still pops up even after confirming to overwrite changes that indicates "changes may not be saved". This code lies within the checIfSaved function that would need a conditional to fix it.

All of the code written for this branch are in the visual-editor.js, editor-app.js, and their corresponding test files.

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

Successfully merging this pull request may close these issues.

1 participant