-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Editor Bug fix: Auto reload after language changing #30363
base: dev
Are you sure you want to change the base?
Conversation
I think this approach is totally fine. If we would need to trigger reloads in multiple locations, using a separate signal might be more clean. But for now this is good enough. |
thank you so much ❤️ editor.config.setKey( 'language', value );
editor.strings = new Strings( editor.config ); it updates the strings class in editor but doesn't update the dom I think I must dig deeper. any ideas? |
I think we would need a new signal that refreshes the entire UI which I don't think is worth implementing. Changing the app's language is normally a one-time operation per workstation so a reload shouldn't be an issue. |
Seems fair. thank you |
editor should autosave once so that even if users disabled autosave they won't lose their current editing after full page reload |
good point I will work on it ASAP |
This is how editor save to IndexedDB: // save to IndexedDB before reloading
editor.storage.set( editor.toJSON(), () => window.location.reload() ) |
how about i work on that matter and in next step i add it to this bug fix? |
@ycw Would the following work instead? Just check if autosave is enabled and if so perform a reload. The config settings can be checked via: editor.config.getKey( 'autosave' ) === true In this way we avoid the issue mentioned in #30363 (comment) and users can save/reload by themselves. |
To best of my knowledge editor saves to IndexedDB is scheduled using setTimeout, where IndexedDB API is not blocking rather using callbacks. If full-page reload e.g. |
Um, maybe we should avoid the reload altogether and force a refresh of the entire UI. I don't like the side effects on the save mechanism of the current approach. |
Alternatively, how about adding a info message next to the language selection that says changing the language requires a restart of the editor? |
my idea was that reloading is supposed to be a temp solution and then work on a UI rerender signal. I am working on it. |
When language is changed user must reload the page manually.
I know this is not the best solution for this purpose but it fixes the bug for now.
I will work on a better solution later.
Please consult me for the better solution (like should I add a new signal or etc...)
Screencast.from.2025-01-20.12-00-34.webm