From 2d42fbd94acc4ed8d6b015a8c7e7337b4589139b Mon Sep 17 00:00:00 2001 From: cogentapps <127109874+cogentapps@users.noreply.github.com> Date: Sun, 2 Jul 2023 08:07:17 +0000 Subject: [PATCH] search adjustments --- app/src/core/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/core/index.ts b/app/src/core/index.ts index e83c40e1..2b54144f 100644 --- a/app/src/core/index.ts +++ b/app/src/core/index.ts @@ -39,7 +39,7 @@ export class ChatManager extends EventEmitter { loadSavedChatsFromPreviousVersion(this.doc) .then(() => this.emit('update')); - setInterval(() => this.emitChanges()); + setInterval(() => this.emitChanges(), 100); channel.onmessage = message => { if (message.type === 'y-update') { @@ -87,7 +87,10 @@ export class ChatManager extends EventEmitter { // connect new doc to persistance, scoped to the current username this.provider = new IndexeddbPersistence('chats:' + username, this.doc.root); this.provider.whenSynced.then(() => { - this.doc.getChatIDs().map(id => this.emit(id)); + this.doc.getChatIDs().map(id => { + this.emit(id); + this.search.update(id); + }); this.emit('update'); this.doc.emit('ready'); this.options.reloadOptions();