File tree 1 file changed +6
-8
lines changed 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';
4
4
import config from '../config/environment' ;
5
5
import * as localStorage from '../utils/local-storage' ;
6
6
7
+ const KNOWN_THEMES = new Set ( [ 'classic' , 'new-design' ] ) ;
8
+
7
9
export default class DesignService extends Service {
8
10
@service fastboot ;
9
11
10
- @tracked useNewDesign = ! this . fastboot . isFastBoot && localStorage . getItem ( 'use-new-design' ) === 'true' ;
12
+ @tracked _theme = localStorage . getItem ( 'theme' ) ;
11
13
@tracked showToggleButton = config . environment === 'development' || config . environment === 'test' ;
12
14
13
15
get theme ( ) {
14
- return this . useNewDesign ? 'new-design' : 'classic' ;
16
+ return KNOWN_THEMES . has ( this . _theme ) ? this . _theme : 'classic' ;
15
17
}
16
18
17
19
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 ) ;
24
22
}
25
23
}
You can’t perform that action at this time.
0 commit comments