-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove toggle button theme from header #4312
Conversation
@@ -44,7 +44,7 @@ export function UserPreferencesDirective( | |||
const body = angular.element('body'); | |||
|
|||
scope.activeNavigation = null; | |||
scope.activeTheme = localStorage.getItem('theme'); | |||
scope.activeTheme = localStorage.getItem('theme') !== '' ? localStorage.getItem('theme') : 'light-ui'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not ideal to read local storage twice. I'd be nicer to do it like this:
scope.activeTheme = localStorage.getItem('theme');
if (scope.activeTheme === '') {
scope.activeTheme = 'light-ui';
}
It would also be better to use a constant instead of inlining light-ui
.
can you use a constant? :) |
@@ -4,6 +4,8 @@ import {gettext} from 'core/utils'; | |||
import {appConfig, getUserInterfaceLanguage} from 'appConfig'; | |||
import {applyDefault} from 'core/helpers/typescript-helpers'; | |||
|
|||
const theme = 'light-ui'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use capital letters for a variable name - THEME_LIGHT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the comment about variable naming
SDESK-7037