Delete sent stories when you turn off stories

This commit is contained in:
Josh Perez 2022-10-19 12:35:56 -04:00 committed by GitHub
parent 622f61903b
commit 3e57899006
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 2 deletions

View file

@ -39,6 +39,7 @@ installSetting('typingIndicatorSetting', {
setter: false,
});
installCallback('deleteAllMyStories');
installCallback('isPhoneNumberSharingEnabled');
installCallback('isPrimary');
installCallback('shouldShowStoriesSettings');

View file

@ -88,6 +88,7 @@ const ipcPNP = createCallback('isPhoneNumberSharingEnabled');
const ipcShouldShowStoriesSettings = createCallback(
'shouldShowStoriesSettings'
);
const ipcDeleteAllMyStories = createCallback('deleteAllMyStories');
// ChatColorPicker redux hookups
// The redux actions update over IPC through a preferences re-render
@ -301,7 +302,13 @@ const renderPreferences = async () => {
onCountMutedConversationsChange: reRender(
settingCountMutedConversations.setValue
),
onHasStoriesDisabledChanged: reRender(settingHasStoriesDisabled.setValue),
onHasStoriesDisabledChanged: reRender(async (value: boolean) => {
await settingHasStoriesDisabled.setValue(value);
if (!value) {
ipcDeleteAllMyStories();
}
return value;
}),
onHideMenuBarChange: reRender(settingHideMenuBar.setValue),
onIncomingCallNotificationsChange: reRender(
settingIncomingCallNotification.setValue