Sync storiesDisabled flag on AccountRecord

This commit is contained in:
Fedor Indutny 2022-10-04 10:53:36 -07:00 committed by GitHub
parent 3e57cb8549
commit 8b705d3b55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 42 additions and 35 deletions

View file

@ -68,7 +68,7 @@ export type PropsDataType = {
hasReadReceipts: boolean;
hasRelayCalls?: boolean;
hasSpellCheck: boolean;
hasStoriesEnabled: boolean;
hasStoriesDisabled: boolean;
hasTypingIndicators: boolean;
lastSyncTime?: number;
notificationContent: NotificationSettingType;
@ -133,7 +133,7 @@ type PropsFunctionType = {
onCallNotificationsChange: CheckboxChangeHandlerType;
onCallRingtoneNotificationChange: CheckboxChangeHandlerType;
onCountMutedConversationsChange: CheckboxChangeHandlerType;
onHasStoriesEnabledChanged: SelectChangeHandlerType<boolean>;
onHasStoriesDisabledChanged: SelectChangeHandlerType<boolean>;
onHideMenuBarChange: CheckboxChangeHandlerType;
onIncomingCallNotificationsChange: CheckboxChangeHandlerType;
onLastSyncTimeChange: (time: number) => unknown;
@ -228,7 +228,7 @@ export const Preferences = ({
hasReadReceipts,
hasRelayCalls,
hasSpellCheck,
hasStoriesEnabled,
hasStoriesDisabled,
hasTypingIndicators,
i18n,
initialSpellCheckSetting,
@ -251,7 +251,7 @@ export const Preferences = ({
onCallNotificationsChange,
onCallRingtoneNotificationChange,
onCountMutedConversationsChange,
onHasStoriesEnabledChanged,
onHasStoriesDisabledChanged,
onHideMenuBarChange,
onIncomingCallNotificationsChange,
onLastSyncTimeChange,
@ -977,7 +977,14 @@ export const Preferences = ({
</label>
}
right={
hasStoriesEnabled ? (
hasStoriesDisabled ? (
<Button
onClick={() => onHasStoriesDisabledChanged(false)}
variant={ButtonVariant.Secondary}
>
{i18n('Preferences__turn-stories-on')}
</Button>
) : (
<Button
className="Preferences__stories-off"
onClick={() => setConfirmStoriesOff(true)}
@ -985,13 +992,6 @@ export const Preferences = ({
>
{i18n('Preferences__turn-stories-off')}
</Button>
) : (
<Button
onClick={() => onHasStoriesEnabledChanged(true)}
variant={ButtonVariant.Secondary}
>
{i18n('Preferences__turn-stories-on')}
</Button>
)
}
/>
@ -1043,7 +1043,7 @@ export const Preferences = ({
dialogName="Preference.turnStoriesOff"
actions={[
{
action: () => onHasStoriesEnabledChanged(false),
action: () => onHasStoriesDisabledChanged(true),
style: 'negative',
text: i18n('Preferences__turn-stories-off--action'),
},