From 9347b12b47bf4ab97ffb7ca92673604b237c1012 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Wed, 27 Jan 2021 00:03:30 -0500 Subject: [PATCH] BasicsPage: fix "show language selector" default Since some boolean settings might be stored as string "0" or "1", the previous system no longer works, and it always sets the switch to true. The "no setting" check has been changed to reference `undefined`, so now the switch will only be defaulted to `true` if the setting truly hasn't been set. Fixes https://github.com/flarum/core/issues/2574 --- js/src/admin/components/BasicsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/admin/components/BasicsPage.js b/js/src/admin/components/BasicsPage.js index c2b6175af6..7b452117d4 100644 --- a/js/src/admin/components/BasicsPage.js +++ b/js/src/admin/components/BasicsPage.js @@ -61,7 +61,7 @@ export default class BasicsPage extends Page { } }); - if (typeof this.values.show_language_selector() !== 'number') this.values.show_language_selector(1); + if (this.values.show_language_selector() === undefined) this.values.show_language_selector(1); } view() {