Automatically reopen DB when closed (e.g. due to SW update)
parent
fd6f81d500
commit
e98495fb50
|
@ -118,6 +118,11 @@ async function handleLocalFileRequest(
|
||||||
// Not initialzed yet, or explicitly in sync mode (so direct server communication requested)
|
// Not initialzed yet, or explicitly in sync mode (so direct server communication requested)
|
||||||
return fetch(request);
|
return fetch(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!db?.isOpen()) {
|
||||||
|
console.log("Detected that the DB was closed, reopening");
|
||||||
|
await db!.open();
|
||||||
|
}
|
||||||
const path = decodeURIComponent(pathname.slice(1));
|
const path = decodeURIComponent(pathname.slice(1));
|
||||||
const data = await fileContentTable.get(path);
|
const data = await fileContentTable.get(path);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
Loading…
Reference in New Issue