diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index 043dcd6dd..f98269898 100644 --- a/ts/components/session/settings/SessionSettings.tsx +++ b/ts/components/session/settings/SessionSettings.tsx @@ -603,11 +603,15 @@ export class SettingsView extends React.Component { let title: string; const currentModel = window.ConversationController.get(blockedNumber); - title = + if (currentModel) { + title = currentModel.getProfileName() || currentModel.getName() || window.i18n('anonymous'); - + } else { + title = window.i18n('anonymous'); + } + title = `${title} ${window.shortenPubkey(blockedNumber)}`; results.push({ @@ -622,7 +626,11 @@ export class SettingsView extends React.Component { }, comparisonValue: undefined, setFn: async () => { - await currentModel.unblock(); + if (currentModel) { + await currentModel.unblock(); + } else { + await BlockedNumberController.unblock(blockedNumber) + } ToastUtils.push({ title: window.i18n('unblocked'), id: 'unblocked',