diff --git a/manifest.json b/manifest.json index 2dc127f..46bdba3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-livesync", "name": "Self-hosted LiveSync", - "version": "0.8.1", + "version": "0.8.2", "minAppVersion": "0.9.12", "description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "author": "vorotamoroz", diff --git a/package-lock.json b/package-lock.json index f039588..3ae58cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-livesync", - "version": "0.8.1", + "version": "0.8.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "obsidian-livesync", - "version": "0.8.1", + "version": "0.8.2", "license": "MIT", "dependencies": { "diff-match-patch": "^1.0.5", @@ -2553,9 +2553,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/mkdirp": { @@ -5391,9 +5391,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mkdirp": { diff --git a/package.json b/package.json index 2394a21..f85aad3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-livesync", - "version": "0.8.1", + "version": "0.8.2", "description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "main": "main.js", "type": "module", diff --git a/src/utils.ts b/src/utils.ts index 1c5b9a3..29de4d0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -66,7 +66,7 @@ export const escapeStringToHTML = (str: string) => { export function resolveWithIgnoreKnownError(p: Promise, def: T): Promise { return new Promise((res, rej) => { - p.then(res).catch((ex) => (ex.status && ex.status == 404 ? res(def) : rej(ex))); + p.then(res).catch((ex) => ((ex.status && ex.status == 404) || (ex.message && ex.message == "Request Error:404") ? res(def) : rej(ex))); }); } diff --git a/src/utils_couchdb.ts b/src/utils_couchdb.ts index d2d6856..8c6e48b 100644 --- a/src/utils_couchdb.ts +++ b/src/utils_couchdb.ts @@ -146,7 +146,7 @@ export const checkRemoteVersion = async (db: PouchDB.Database, migrate: (from: n if (version == barrier) return true; return false; } catch (ex) { - if (ex.status && ex.status == 404) { + if ((ex.status && ex.status == 404) || (ex.message && ex.message == "Request Error:404")) { if (await bumpRemoteVersion(db)) { return true; }