1
0
mirror of https://github.com/vrtmrz/obsidian-livesync.git synced 2024-12-12 09:04:06 +02:00

Fixed parameter mistake.

Getting ready for webclip
This commit is contained in:
vorotamoroz 2021-10-20 18:43:53 +09:00
parent 39e2eab023
commit d746c1cb52
3 changed files with 9 additions and 5 deletions

10
main.ts
View File

@ -147,7 +147,11 @@ function base64ToArrayBuffer(base64: string): ArrayBuffer {
} }
return bytes.buffer; return bytes.buffer;
} catch (ex) { } catch (ex) {
return null; return new Uint16Array(
[].map.call(base64, function (c: string) {
return c.charCodeAt(0);
})
).buffer;
} }
} }
function base64ToString(base64: string): string { function base64ToString(base64: string): string {
@ -160,7 +164,7 @@ function base64ToString(base64: string): string {
} }
return new TextDecoder().decode(bytes); return new TextDecoder().decode(bytes);
} catch (ex) { } catch (ex) {
return null; return base64;
} }
} }
@ -305,7 +309,7 @@ class LocalPouchDB {
} }
// wait // wait
waitForLeafReady(id: string): Promise<boolean> { waitForLeafReady(id: string): Promise<boolean> {
return new Promise((_, res) => { return new Promise((res) => {
// Set timeout. // Set timeout.
let timer = setTimeout(() => res(false), LEAF_WAIT_TIMEOUT); let timer = setTimeout(() => res(false), LEAF_WAIT_TIMEOUT);
if (typeof this.leafArrivedCallbacks[id] == "undefined") { if (typeof this.leafArrivedCallbacks[id] == "undefined") {

View File

@ -1,7 +1,7 @@
{ {
"id": "obsidian-livesync", "id": "obsidian-livesync",
"name": "Obsidian Live sync", "name": "Obsidian Live sync",
"version": "0.1.3", "version": "0.1.4",
"minAppVersion": "0.9.12", "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.", "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", "author": "vorotamoroz",

View File

@ -1,6 +1,6 @@
{ {
"name": "obsidian-livesync", "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.", "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", "main": "main.js",
"scripts": { "scripts": {