From e1732cfa1051439466af0bc25a38fe149350dfca Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 1 Feb 2022 00:11:25 +1000 Subject: [PATCH] Fix various bugs in Options page (#1418) * Remove duplicate message in toast * Set starting variables properly --- src/app/settings/options.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/settings/options.component.ts b/src/app/settings/options.component.ts index 996ea8bbb3..4090950b64 100644 --- a/src/app/settings/options.component.ts +++ b/src/app/settings/options.component.ts @@ -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")); } }