- if (!this.draftHasError) {
- this.draftHasError = true;
- window.$events.emit('error', this.autosaveFailText);
- }
+ // Save the editor content in LocalStorage as a last resort, just in case.
+ try {
+ const saveKey = `draft-save-fail-${(new Date()).toISOString()}`;
+ window.localStorage.setItem(saveKey, JSON.stringify(data));
+ } catch (err) {}
+
+ window.$events.emit('error', this.autosaveFailText);