Fix duplicate timeline items for group call events

This commit is contained in:
Evan Hahn 2020-12-09 14:57:34 -06:00 committed by GitHub
parent 8c771ccb89
commit 496bdec35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -2097,9 +2097,12 @@ export class ConversationModel extends window.Backbone.Model<
eraId: string,
creatorUuid: string
): Promise<void> {
// We want to update the cache quickly in case this function is called multiple times.
const oldCachedEraId = this.cachedLatestGroupCallEraId;
this.cachedLatestGroupCallEraId = eraId;
const alreadyHasMessage =
(this.cachedLatestGroupCallEraId &&
this.cachedLatestGroupCallEraId === eraId) ||
(oldCachedEraId && oldCachedEraId === eraId) ||
(await window.Signal.Data.hasGroupCallHistoryMessage(this.id, eraId));
if (!alreadyHasMessage) {
@ -2110,8 +2113,6 @@ export class ConversationModel extends window.Backbone.Model<
startedTime: Date.now(),
});
}
this.cachedLatestGroupCallEraId = eraId;
}
async addProfileChange(