make blockled list number updates on unblock

pull/1308/head
Audric Ackermann 5 years ago
parent d108630f22
commit 4fbbbc26a4
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1563,6 +1563,9 @@
"unblockUser": {
"message": "Unblock User"
},
"unblocked": {
"message": "Unblocked"
},
"blockedSettingsTitle": {
"message": "Blocked Users",
"description": "Shown in the settings page as the heading for the blocked user settings"

@ -600,22 +600,20 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
const blockedNumbers = BlockedNumberController.getBlockedNumbers();
for (const blockedNumber of blockedNumbers) {
let displayName = `User (...${blockedNumber.substr(-6)})`;
let title: string;
const currentModel = window.ConversationController.get(blockedNumber);
if (
currentModel &&
currentModel.attributes.profile &&
currentModel.attributes.profile.displayName
) {
displayName = currentModel.attributes.profile.displayName
}
title =
currentModel.getProfileName() ||
currentModel.getName() ||
window.i18n('anonymous');
title = `${title} ${window.shortenPubkey(blockedNumber)}`;
results.push({
id: blockedNumber,
title: displayName,
description: blockedNumber,
title,
description: '',
type: SessionSettingType.Button,
category: SessionSettingCategory.Blocked,
content: {
@ -624,7 +622,11 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
},
comparisonValue: undefined,
setFn: async () => {
await BlockedNumberController.unblock(blockedNumber)
await currentModel.unblock();
ToastUtils.push({
title: window.i18n('unblocked'),
id: 'unblocked',
});
},
hidden: false,
onClick: undefined,

Loading…
Cancel
Save