From d746c1cb5268066886ee14534df057c58c604fdb Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Wed, 20 Oct 2021 18:43:53 +0900 Subject: [PATCH] Fixed parameter mistake. Getting ready for webclip --- main.ts | 10 +++++++--- manifest.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/main.ts b/main.ts index 29c0b23..14414f7 100644 --- a/main.ts +++ b/main.ts @@ -147,7 +147,11 @@ function base64ToArrayBuffer(base64: string): ArrayBuffer { } return bytes.buffer; } catch (ex) { - return null; + return new Uint16Array( + [].map.call(base64, function (c: string) { + return c.charCodeAt(0); + }) + ).buffer; } } function base64ToString(base64: string): string { @@ -160,7 +164,7 @@ function base64ToString(base64: string): string { } return new TextDecoder().decode(bytes); } catch (ex) { - return null; + return base64; } } @@ -305,7 +309,7 @@ class LocalPouchDB { } // wait waitForLeafReady(id: string): Promise { - return new Promise((_, res) => { + return new Promise((res) => { // Set timeout. let timer = setTimeout(() => res(false), LEAF_WAIT_TIMEOUT); if (typeof this.leafArrivedCallbacks[id] == "undefined") { diff --git a/manifest.json b/manifest.json index 8e27a2f..d01065d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-livesync", "name": "Obsidian Live sync", - "version": "0.1.3", + "version": "0.1.4", "minAppVersion": "0.9.12", "description": "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.json b/package.json index 70a7346..4d2dc6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-livesync", - "version": "0.1.3", + "version": "0.1.4", "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", "scripts": {