fix settings edition

This commit is contained in:
Nicolas Constant 2020-03-28 23:47:23 -04:00
parent 239aa36109
commit ff7148c33b
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,7 @@ export class SettingsState {
let newSettings = new GlobalSettings();
newSettings = this.setGlobalSettingsValues(newSettings, state.settings);
newSettings.contentWarningPolicy = state.settings.contentWarningPolicy;
newSettings.accountSettings = [...state.settings.accountSettings.filter(x => x.accountId !== action.accountId)];
ctx.patchState({
@ -98,6 +99,7 @@ export class SettingsState {
let newSettings = new GlobalSettings();
newSettings = this.setGlobalSettingsValues(newSettings, state.settings);
newSettings.contentWarningPolicy = state.settings.contentWarningPolicy;
newSettings.accountSettings = [...state.settings.accountSettings.filter(x => x.accountId !== action.accountSettings.accountId), action.accountSettings];
ctx.patchState({
@ -111,6 +113,7 @@ export class SettingsState {
let newSettings = new GlobalSettings();
newSettings = this.setGlobalSettingsValues(newSettings, action.settings);
newSettings.contentWarningPolicy = state.settings.contentWarningPolicy;
newSettings.accountSettings = [...state.settings.accountSettings];
ctx.patchState({