mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-27 18:31:07 +00:00
Fix admin editing instance language
Closes #976 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
19bf587dc9
commit
15d186cc25
1 changed files with 6 additions and 2 deletions
|
@ -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<void> {
|
||||
|
|
Loading…
Reference in a new issue