diff --git a/ts/state/smart/Preferences.tsx b/ts/state/smart/Preferences.tsx index 52f5f444a4..3f877698b2 100644 --- a/ts/state/smart/Preferences.tsx +++ b/ts/state/smart/Preferences.tsx @@ -67,6 +67,7 @@ import { EditState } from '../../components/ProfileEditor'; import { SmartToastManager } from './ToastManager'; import { useToastActions } from '../ducks/toast'; import { DataReader } from '../../sql/Client'; +import { deleteAllMyStories } from '../../util/deleteAllMyStories'; import type { StorageAccessType, ZoomFactorType } from '../../types/Storage'; import type { ThemeType } from '../../util/preload'; @@ -551,10 +552,13 @@ export function SmartPreferences(): JSX.Element | null { const [hasStoriesDisabled, onHasStoriesDisabledChanged] = createItemsAccess( 'hasStoriesDisabled', false, - value => { + async value => { const account = window.ConversationController.getOurConversationOrThrow(); account.captureChange('hasStoriesDisabled'); window.textsecure.server?.onHasStoriesDisabledChange(value); + if (!value) { + await deleteAllMyStories(); + } } ); const [hasTextFormatting, onTextFormattingChange] = createItemsAccess( diff --git a/ts/util/createIPCEvents.ts b/ts/util/createIPCEvents.ts index ba390ea729..3c7d84428c 100644 --- a/ts/util/createIPCEvents.ts +++ b/ts/util/createIPCEvents.ts @@ -191,6 +191,7 @@ export function createIPCEvents( }, setLocaleOverride: async (value: string | null) => { await setEphemeralSetting('localeOverride', value); + window.SignalContext.restartApp(); }, getContentProtection: async () => { return (