File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,20 @@ import { tracked } from '@glimmer/tracking';
44import config from '../config/environment' ;
55import * as localStorage from '../utils/local-storage' ;
66
7+ const KNOWN_THEMES = new Set ( [ 'classic' , 'new-design' ] ) ;
8+
79export default class DesignService extends Service {
810 @service fastboot ;
911
10- @tracked useNewDesign = ! this . fastboot . isFastBoot && localStorage . getItem ( 'use-new-design' ) === 'true' ;
12+ @tracked _theme = localStorage . getItem ( 'theme' ) ;
1113 @tracked showToggleButton = config . environment === 'development' || config . environment === 'test' ;
1214
1315 get theme ( ) {
14- return this . useNewDesign ? 'new-design' : 'classic' ;
16+ return KNOWN_THEMES . has ( this . _theme ) ? this . _theme : 'classic' ;
1517 }
1618
1719 set theme ( theme ) {
18- this . setNewDesign ( theme === 'new-design' ) ;
19- }
20-
21- setNewDesign ( value ) {
22- this . useNewDesign = value ;
23- localStorage . setItem ( 'use-new-design' , String ( this . useNewDesign ) ) ;
20+ this . _theme = theme ;
21+ localStorage . setItem ( 'theme' , theme ) ;
2422 }
2523}
You can’t perform that action at this time.
0 commit comments