mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
remove fileHandle
from IDB if user rejects permission
This commit is contained in:
parent
ba705a099a
commit
f5f4ec7528
1 changed files with 13 additions and 1 deletions
|
@ -150,11 +150,23 @@ export const actionSaveToActiveFile = register({
|
||||||
if (error?.name !== "AbortError") {
|
if (error?.name !== "AbortError") {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fileHandleExists && error.name === "AbortError") {
|
||||||
|
try {
|
||||||
|
await idb.del(IDB_KEYS.fileHandle);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
commitToHistory: false,
|
commitToHistory: false,
|
||||||
appState: { ...appState, fileHandle: null },
|
appState: { ...appState, fileHandle: null },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
commitToHistory: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
keyTest: (event) =>
|
keyTest: (event) =>
|
||||||
event.key === KEYS.S && event[KEYS.CTRL_OR_CMD] && !event.shiftKey,
|
event.key === KEYS.S && event[KEYS.CTRL_OR_CMD] && !event.shiftKey,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue