Skip to content

Commit

Permalink
search adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Jul 2, 2023
1 parent 56582e6 commit 2d42fbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2d42fbd

Please sign in to comment.