| @@ -16,15 +16,15 @@ | ||
| 16 | 16 | detachKeyboardUndo, |
| 17 | 17 | } from './lib/keyboard-undo'; |
| 18 | 18 | import { fetchLinkSuggestions } from './lib/link-suggestions'; |
| 19 | 19 | // Side-effect import: subscribes html.extendify-quick-edit-on before first paint. |
| 20 | -import { useEditModeStore } from './state/edit-mode'; | |
| 20 | +import { STORAGE_KEY, useEditModeStore } from './state/edit-mode'; | |
| 21 | 21 | import { useQuickEditStore } from './state/store'; |
| 22 | 22 | |
| 23 | 23 | import './quick-edit.css'; |
| 24 | 24 | |
| 25 | 25 | // Cross-bundle race: edit-mode.js is shared with the Agent bundle (via |
| 26 | -// Chat.jsx + ChatTools.jsx). When the Agent bundle's script tag fires | |
| 26 | +// Chat.jsx and the QuickEdit store). When the Agent bundle's script tag fires | |
| 27 | 27 | // first, the shared chunk evaluates before this bundle's inline |
| 28 | 28 | // `window.extQuickEditData = …` has run, so DEFAULT_ON resolves to |
| 29 | 29 | // false and the store freezes with on=false. By the time THIS module |
| 30 | 30 | // loads, our `'before'` inline has fired, so re-seed if the server says |
| @@ -33,11 +33,9 @@ | ||
| 33 | 33 | if (isEmbedded()) return; |
| 34 | 34 | if (!window.extQuickEditData?.defaultOn) return; |
| 35 | 35 | let persisted; |
| 36 | 36 | try { |
| 37 | - persisted = JSON.parse( | |
| 38 | - localStorage.getItem('extendify-quick-edit-mode') ?? 'null', | |
| 39 | - ); | |
| 37 | + persisted = JSON.parse(localStorage.getItem(STORAGE_KEY) ?? 'null'); | |
| 40 | 38 | } catch { |
| 41 | 39 | persisted = null; |
| 42 | 40 | } |
| 43 | 41 | if (persisted) return; |