Slight tweaks

This commit is contained in:
Zef Hemel
2023-11-25 14:30:31 +01:00
parent 0382ed4f0d
commit 8d326a668b
5 changed files with 24 additions and 71 deletions
+12 -1
View File
@@ -191,6 +191,17 @@ export class Client {
console.warn("Not authenticated, redirecting to auth page");
return;
}
if (e.message.includes("Offline") && !this.syncMode) {
// Offline and not in sync mode, this is not going to fly.
this.flashNotification(
"Could not reach remote server, going to reload in a few seconds",
"error",
);
setTimeout(() => {
location.reload();
}, 5000);
throw e;
}
console.warn(
"Could not reach remote server, we're offline or the server is down",
e,
@@ -433,7 +444,7 @@ export class Client {
try {
settingsText = (await this.space.readPage("SETTINGS")).text;
} catch (e) {
} catch (e: any) {
console.info("No SETTINGS page, falling back to default", e);
settingsText = '```yaml\nindexPage: "[[index]]"\n```\n';
}