web: ensure that images get downloaded on realtime sync

This commit is contained in:
Abdullah Atta
2023-02-28 12:10:51 +05:00
committed by Abdullah Atta
parent e53cc648f0
commit 24c899e709

View File

@@ -119,13 +119,17 @@ export default function EditorManager({
editorInstance.current?.updateContent(item.data as string);
db.eventManager.subscribe(
EVENTS.syncCompleted,
async () => {
await db.attachments?.downloadMedia(id);
},
true
);
if (appstore.get().isSyncing()) {
db.eventManager.subscribe(
EVENTS.syncCompleted,
async () => {
await db.attachments?.downloadMedia(id);
},
true
);
} else {
await db.attachments?.downloadMedia(id);
}
} else if (isNote) {
if (!locked && item.locked) return EV.publish(EVENTS.vaultLocked);