mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 17:08:57 +01:00
Make that theme values are in the expected range
This commit is contained in:
+6
-2
@@ -253,8 +253,12 @@ async function getThemeSetting({
|
||||
|
||||
const json = await sql.sqlCall('getItemById', ['theme-setting']);
|
||||
|
||||
// Default to `system` if setting doesn't exist yet
|
||||
const slowValue = json ? json.value : 'system';
|
||||
// Default to `system` if setting doesn't exist or is invalid
|
||||
const setting: unknown = json?.value;
|
||||
const slowValue =
|
||||
setting === 'light' || setting === 'dark' || setting === 'system'
|
||||
? setting
|
||||
: 'system';
|
||||
|
||||
ephemeralConfig.set('theme-setting', slowValue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user