Skip to content
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

Merged
merged 5 commits into from
Sep 14, 2023

Conversation

dzonidoo
Copy link
Collaborator

SDESK-7037

@@ -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';
Copy link
Member

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.

@tomaskikutis
Copy link
Member

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';
Copy link
Member

@tomaskikutis tomaskikutis Aug 30, 2023

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

Copy link
Member

@tomaskikutis tomaskikutis left a 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

@dzonidoo dzonidoo merged commit d088323 into superdesk:develop Sep 14, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants