mirror of
https://github.com/excalidraw/excalidraw.git
synced 2026-11-30 17:11:01 +03:00
remove fileHandle from IDB if user rejects permission
This commit is contained in:
1 parent
ba705a099a
commit
f5f4ec7528
1 file changed
+13
-1
@@ -150,9 +150,21 @@ export const actionSaveToActiveFile = register({
|
||||
if (error?.name !== "AbortError") {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
if (fileHandleExists && error.name === "AbortError") {
|
||||
try {
|
||||
await idb.del(IDB_KEYS.fileHandle);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
return {
|
||||
commitToHistory: false,
|
||||
appState: { ...appState, fileHandle: null },
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
commitToHistory: false,
|
||||
appState: { ...appState, fileHandle: null },
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user