mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-02-16 09:10:38 +00:00
Fixed:
- Failure on the first sync
This commit is contained in:
@@ -66,7 +66,7 @@ export const escapeStringToHTML = (str: string) => {
|
||||
|
||||
export function resolveWithIgnoreKnownError<T>(p: Promise<T>, def: T): Promise<T> {
|
||||
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)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user