mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
remove fileHandle
from IDB if user rejects permission
This commit is contained in:
@ -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