search adjustments

main
cogentapps 2023-07-02 08:07:17 +00:00
parent 56582e6f5e
commit 2d42fbd94a
1 changed files with 5 additions and 2 deletions

View File

@ -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();