From 73c5429058edc43dd05743ebebd3d8486bfce30e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 21 Dec 2021 19:47:54 +0100 Subject: [PATCH] Fix admin editing instance language Closes #976 Signed-off-by: Thomas Citharel --- js/src/views/Admin/Settings.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/src/views/Admin/Settings.vue b/js/src/views/Admin/Settings.vue index 4e0d5fab0..9a8e8c90c 100644 --- a/js/src/views/Admin/Settings.vue +++ b/js/src/views/Admin/Settings.vue @@ -433,18 +433,22 @@ export default class Settings extends Vue { RouteName = RouteName; get instanceLanguages(): string[] { - const languageCodes = this.adminSettings.instanceLanguages || []; + const languageCodes = [...this.adminSettings.instanceLanguages] || []; return languageCodes .map((code) => this.languageForCode(code)) .filter((language) => language) as string[]; } set instanceLanguages(instanceLanguages: string[]) { - this.adminSettings.instanceLanguages = instanceLanguages + const newInstanceLanguages = instanceLanguages .map((language) => { return this.codeForLanguage(language); }) .filter((code) => code !== undefined) as string[]; + this.adminSettings = { + ...this.adminSettings, + instanceLanguages: newInstanceLanguages, + }; } async updateSettings(): Promise {