From e5ee3467ac81ed3163a021225c6737d63d306b8a Mon Sep 17 00:00:00 2001 From: Brice-W Date: Thu, 12 Aug 2021 16:17:10 +1000 Subject: [PATCH] fix popup issue around link preview setting --- .../session/settings/SessionSettings.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index 4a285b060..c9930d5cc 100644 --- a/ts/components/session/settings/SessionSettings.tsx +++ b/ts/components/session/settings/SessionSettings.tsx @@ -19,7 +19,7 @@ import { SessionConfirmDialogProps } from '../../dialog/SessionConfirm'; import { mapDispatchToProps } from '../../../state/actions'; import { unblockConvoById } from '../../../interactions/conversationInteractions'; import { toggleAudioAutoplay } from '../../../state/ducks/userConfig'; -import { sessionPassword } from '../../../state/ducks/modalDialog'; +import { sessionPassword, updateConfirmModal } from '../../../state/ducks/modalDialog'; import { PasswordAction } from '../../dialog/SessionPasswordDialog'; import { SessionIconButton, SessionIconSize, SessionIconType } from '../icon'; @@ -356,17 +356,20 @@ class SettingsViewInner extends React.Component { window.setSettingValue('link-preview-setting', newValue); if (!newValue) { await createOrUpdateItem({ id: hasLinkPreviewPopupBeenDisplayed, value: false }); + } else { + window.inboxStore?.dispatch( + updateConfirmModal({ + title: window.i18n('linkPreviewsTitle'), + message: window.i18n('linkPreviewsConfirmMessage'), + okTheme: SessionButtonColor.Danger, + }) + ); } }, content: undefined, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: { - shouldShowConfirm: !window.getSettingValue('link-preview-setting'), - title: window.i18n('linkPreviewsTitle'), - message: window.i18n('linkPreviewsConfirmMessage'), - okTheme: SessionButtonColor.Danger, - }, + confirmationDialogParams: undefined, }, { id: 'audio-message-autoplay-setting',