Skip to content

Commit

Permalink
Clear profile avatar when we discover that it has been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jul 2, 2021
1 parent 299fe2a commit b50bf58
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ts/models/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b50bf58

Please sign in to comment.