mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 17:55:56 +00:00
fixed leaked logging
This commit is contained in:
24
src/main.ts
24
src/main.ts
@@ -740,10 +740,10 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
|
|
||||||
async decryptConfigurationItem(encrypted: string, passphrase: string) {
|
async decryptConfigurationItem(encrypted: string, passphrase: string) {
|
||||||
const dec = await tryDecrypt(encrypted, passphrase + SALT_OF_PASSPHRASE, false);
|
const dec = await tryDecrypt(encrypted, passphrase + SALT_OF_PASSPHRASE, false);
|
||||||
if (dec) {
|
if (dec) {
|
||||||
this.usedPassphrase = passphrase;
|
this.usedPassphrase = passphrase;
|
||||||
return dec;
|
return dec;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tryDecodeJson(encoded: string | false): object | false {
|
tryDecodeJson(encoded: string | false): object | false {
|
||||||
@@ -766,10 +766,10 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
const dec = await encrypt(src, passphrase + SALT_OF_PASSPHRASE, false);
|
const dec = await encrypt(src, passphrase + SALT_OF_PASSPHRASE, false);
|
||||||
if (dec) {
|
if (dec) {
|
||||||
this.usedPassphrase = passphrase;
|
this.usedPassphrase = passphrase;
|
||||||
return dec;
|
return dec;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -799,9 +799,9 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
if (settings.encrypt && settings.encryptedPassphrase) {
|
if (settings.encrypt && settings.encryptedPassphrase) {
|
||||||
const encrypted = settings.encryptedPassphrase;
|
const encrypted = settings.encryptedPassphrase;
|
||||||
const decrypted = await this.decryptConfigurationItem(encrypted, passphrase);
|
const decrypted = await this.decryptConfigurationItem(encrypted, passphrase);
|
||||||
if (decrypted) {
|
if (decrypted) {
|
||||||
settings.passphrase = decrypted;
|
settings.passphrase = decrypted;
|
||||||
} else {
|
} else {
|
||||||
Logger("Could not decrypt passphrase for reading data.json! DO NOT synchronize with the remote before making sure your configuration is!", LOG_LEVEL.URGENT);
|
Logger("Could not decrypt passphrase for reading data.json! DO NOT synchronize with the remote before making sure your configuration is!", LOG_LEVEL.URGENT);
|
||||||
settings.passphrase = "";
|
settings.passphrase = "";
|
||||||
}
|
}
|
||||||
@@ -1000,7 +1000,6 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.queuedFilesStore.set({ queuedItems: this.queuedFiles, fileEventItems: this.watchedFileEventQueue });
|
this.queuedFilesStore.set({ queuedItems: this.queuedFiles, fileEventItems: this.watchedFileEventQueue });
|
||||||
console.dir([...this.watchedFileEventQueue]);
|
|
||||||
if (this.isReady) {
|
if (this.isReady) {
|
||||||
await this.procFileEvent(forcePerform);
|
await this.procFileEvent(forcePerform);
|
||||||
}
|
}
|
||||||
@@ -1029,7 +1028,6 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
do {
|
do {
|
||||||
const queue = procs.shift();
|
const queue = procs.shift();
|
||||||
if (queue === undefined) break L1;
|
if (queue === undefined) break L1;
|
||||||
console.warn([queue.type, { ...queue.args, cache: undefined }]);
|
|
||||||
|
|
||||||
const file = queue.args.file;
|
const file = queue.args.file;
|
||||||
const key = `file-last-proc-${queue.type}-${file.path}`;
|
const key = `file-last-proc-${queue.type}-${file.path}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user