Make that theme values are in the expected range
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
c89953aa4d
commit
dc57aa1863
|
@ -253,8 +253,12 @@ async function getThemeSetting({
|
||||||
|
|
||||||
const json = await sql.sqlCall('getItemById', ['theme-setting']);
|
const json = await sql.sqlCall('getItemById', ['theme-setting']);
|
||||||
|
|
||||||
// Default to `system` if setting doesn't exist yet
|
// Default to `system` if setting doesn't exist or is invalid
|
||||||
const slowValue = json ? json.value : 'system';
|
const setting: unknown = json?.value;
|
||||||
|
const slowValue =
|
||||||
|
setting === 'light' || setting === 'dark' || setting === 'system'
|
||||||
|
? setting
|
||||||
|
: 'system';
|
||||||
|
|
||||||
ephemeralConfig.set('theme-setting', slowValue);
|
ephemeralConfig.set('theme-setting', slowValue);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue