Settings Tab: When settings change, make proper updates

This commit is contained in:
Scott Nonnenberg 2025-06-04 04:05:30 +10:00 committed by GitHub
parent 7e40d7d887
commit 6ca0cd73b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -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(

View file

@ -191,6 +191,7 @@ export function createIPCEvents(
},
setLocaleOverride: async (value: string | null) => {
await setEphemeralSetting('localeOverride', value);
window.SignalContext.restartApp();
},
getContentProtection: async () => {
return (