Clear profile avatar when we discover that it has been removed
This commit is contained in:
@@ -4589,12 +4589,17 @@ export class ConversationModel extends window.Backbone
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setProfileAvatar(avatarPath: undefined | null | string): Promise<void> {
|
async setProfileAvatar(avatarPath: undefined | null | string): Promise<void> {
|
||||||
if (!avatarPath) {
|
if (isMe(this.attributes)) {
|
||||||
return;
|
if (avatarPath) {
|
||||||
|
window.storage.put('avatarUrl', avatarPath);
|
||||||
|
} else {
|
||||||
|
window.storage.remove('avatarUrl');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMe(this.attributes)) {
|
if (!avatarPath) {
|
||||||
window.storage.put('avatarUrl', avatarPath);
|
this.set({ profileAvatar: undefined });
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const avatar = await window.textsecure.messaging.getAvatar(avatarPath);
|
const avatar = await window.textsecure.messaging.getAvatar(avatarPath);
|
||||||
|
Reference in New Issue
Block a user