Fix privacy settings update processing (#1903)

This commit is contained in:
Alexander Zinchuk 2022-05-31 20:59:00 +04:00
parent 4cef87e2ab
commit ac630f49c4

View File

@ -1,6 +1,5 @@
import { addActionHandler, getGlobal, setGlobal } from '../../index';
import type { ApiPrivacyKey } from '../../../types';
import { PaymentStep } from '../../../types';
import {
@ -46,7 +45,16 @@ addActionHandler('apiUpdate', (global, actions, update) => {
break;
case 'updatePrivacy':
global.settings.privacy[update.key as ApiPrivacyKey] = update.rules;
setGlobal({
...global,
settings: {
...global.settings,
privacy: {
...global.settings.privacy,
[update.key]: update.rules,
},
},
});
break;
case 'updatePaymentVerificationNeeded':