fix: extra indexed db update on mount (reload) causing repeated popups of unsaved changes (#4808)
* docs: update self-host guide link in README (#4704) found via: - https://github.com/makeplane/docs/issues/48 - https://github.com/makeplane/plane/pull/3109 * fix: extra indexed db update on mount causing repeated popups on unload * revert: old stuff --------- Co-authored-by: jon ⚝ <jon@allmende.io>
This commit is contained in:
parent
c5b1d95c76
commit
71c77d30a0
3 changed files with 14 additions and 1 deletions
|
|
@ -59,6 +59,9 @@ export const useDocumentEditor = ({
|
|||
// indexedDB provider
|
||||
useLayoutEffect(() => {
|
||||
const localProvider = new IndexeddbPersistence(id, provider.document);
|
||||
localProvider.on("synced", () => {
|
||||
provider.setHasIndexedDBSynced(true);
|
||||
});
|
||||
return () => {
|
||||
localProvider?.destroy();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue