Clear profile avatar when we discover that it has been removed

This commit is contained in:
Scott Nonnenberg 2021-07-02 13:16:23 -07:00 committed by GitHub
parent 299fe2af36
commit b50bf58418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -4589,12 +4589,17 @@ export class ConversationModel extends window.Backbone
}
async setProfileAvatar(avatarPath: undefined | null | string): Promise<void> {
if (!avatarPath) {
return;
if (isMe(this.attributes)) {
if (avatarPath) {
window.storage.put('avatarUrl', avatarPath);
} else {
window.storage.remove('avatarUrl');
}
}
if (isMe(this.attributes)) {
window.storage.put('avatarUrl', avatarPath);
if (!avatarPath) {
this.set({ profileAvatar: undefined });
return;
}
const avatar = await window.textsecure.messaging.getAvatar(avatarPath);