Fix various bugs in Options page (#1418)

* Remove duplicate message in toast

* Set starting variables properly
This commit is contained in:
Thomas Rittson 2022-02-01 00:11:25 +10:00 committed by GitHub
parent ce1ae208d1
commit e1732cfa10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -74,8 +74,12 @@ export class OptionsComponent implements OnInit {
this.disableIcons = await this.stateService.getDisableFavicon();
this.enableGravatars = await this.stateService.getEnableGravitars();
this.enableFullWidth = await this.stateService.getEnableFullWidth();
this.locale = (await this.stateService.getLocale()) ?? this.startingLocale;
this.theme = (await this.stateService.getTheme()) ?? this.startingTheme;
this.locale = await this.stateService.getLocale();
this.startingLocale = this.locale;
this.theme = await this.stateService.getTheme();
this.startingTheme = this.theme;
}
async submit() {
@ -104,10 +108,7 @@ export class OptionsComponent implements OnInit {
if (this.locale !== this.startingLocale) {
window.location.reload();
} else {
this.platformUtilsService.showToast("success", null, [
this.i18nService.t("optionsUpdated"),
this.i18nService.t("optionsUpdated"),
]);
this.platformUtilsService.showToast("success", null, this.i18nService.t("optionsUpdated"));
}
}