1
0

More sync debugging statements

This commit is contained in:
Zef Hemel 2023-08-09 17:22:42 +02:00
parent be8007c9e4
commit 52fdc14ee4
2 changed files with 4 additions and 1 deletions

View File

@ -168,7 +168,9 @@ export class Client {
await this.dispatchAppEvent("editor:init"); await this.dispatchAppEvent("editor:init");
setInterval(() => { setInterval(() => {
this.syncService.syncFile(`${this.currentPage!}.md`); this.syncService.syncFile(`${this.currentPage!}.md`).catch((e: any) => {
console.error("Interval sync error", e);
});
}, pageSyncInterval); }, pageSyncInterval);
} }

View File

@ -249,6 +249,7 @@ export class SyncService {
await this.spaceSync.syncFile(snapshot, name, localHash, remoteHash); await this.spaceSync.syncFile(snapshot, name, localHash, remoteHash);
this.eventHook.dispatchEvent("sync:success"); this.eventHook.dispatchEvent("sync:success");
console.log("File successfully synced", name);
} catch (e: any) { } catch (e: any) {
this.eventHook.dispatchEvent("sync:error", e.message); this.eventHook.dispatchEvent("sync:error", e.message);
console.error("Sync error", e); console.error("Sync error", e);