1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Dark Mode: Set to default based on user preferred scheme (#15870)

This commit is contained in:
David Walsh 2023-01-06 14:07:47 -06:00 committed by GitHub
parent 87ce653c86
commit dc3a09de16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import {
} from '../../../shared/constants/network';
import { isPrefixedFormattedHexString } from '../../../shared/modules/network.utils';
import { LEDGER_TRANSPORT_TYPES } from '../../../shared/constants/hardware-wallets';
import { THEME_TYPE } from '../../../ui/pages/settings/settings-tab/settings-tab.constant';
import { NETWORK_EVENTS } from './network';
export default class PreferencesController {
@ -69,9 +70,9 @@ export default class PreferencesController {
ledgerTransportType: window.navigator.hid
? LEDGER_TRANSPORT_TYPES.WEBHID
: LEDGER_TRANSPORT_TYPES.U2F,
theme: 'light',
improvedTokenAllowanceEnabled: false,
transactionSecurityCheckEnabled: false,
theme: THEME_TYPE.OS,
...opts.initState,
};

View File

@ -388,14 +388,14 @@ describe('preferences controller', function () {
});
describe('setTheme', function () {
it('should default to value "light"', function () {
it('should default to value "OS"', function () {
const state = preferencesController.store.getState();
assert.equal(state.theme, 'light');
assert.equal(state.theme, 'os');
});
it('should set the setTheme property in state', function () {
const state = preferencesController.store.getState();
assert.equal(state.theme, 'light');
assert.equal(state.theme, 'os');
preferencesController.setTheme('dark');
assert.equal(preferencesController.store.getState().theme, 'dark');
});