Skip to content

Commit 675f63d

Browse files
committed
force to compare the bool value from localStorage, it's make sense and avoid a bug if setItem with false explicit
1 parent 12473f3 commit 675f63d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src-react/reducers/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function app(state, action, config) {
55
switch(action.type) {
66
case types.RECEIVE_UNGIT_CONFIG: {
77
const { ungitConfig } = config;
8-
const bugtrackingNagscreenDismissed = localStorage.getItem('bugtrackingNagscreenDismissed');
8+
const bugtrackingNagscreenDismissed = localStorage.getItem('bugtrackingNagscreenDismissed') === 'true';
99
const showBugtrackingNagscreen = !ungitConfig.config.bugtracking && !bugtrackingNagscreenDismissed;
1010

1111
return { ...state, showBugtrackingNagscreen };
@@ -14,9 +14,9 @@ function app(state, action, config) {
1414
case types.RECEIVE_GIT_VERSION: {
1515
const { ungitConfig, versions: { gitVersion } } = config;
1616
const gitVersionCheckOverride = ungitConfig.config && ungitConfig.config.gitVersionCheckOverride;
17-
const gitVersionErrorDismissed = localStorage.getItem('gitVersionErrorDismissed');
17+
const gitVersionErrorDismissed = localStorage.getItem('gitVersionErrorDismissed') === 'true';
1818
const gitVersionError = gitVersion && !gitVersion.satisfied && gitVersion.error;
19-
const gitVersionErrorVisible = !gitVersionCheckOverride && gitVersionError && gitVersionErrorDismissed;
19+
const gitVersionErrorVisible = !gitVersionCheckOverride && gitVersionError && !gitVersionErrorDismissed;
2020

2121
return { ...state, gitVersionErrorVisible };
2222
}
@@ -32,7 +32,7 @@ function app(state, action, config) {
3232

3333
case types.RECEIVE_USER_CONFIG: {
3434
const { userConfig } = config;
35-
const bugtrackingNagscreenDismissed = localStorage.getItem('bugtrackingNagscreenDismissed');
35+
const bugtrackingNagscreenDismissed = localStorage.getItem('bugtrackingNagscreenDismissed') === 'true';
3636
const showBugtrackingNagscreen = !userConfig.bugtracking && !bugtrackingNagscreenDismissed;
3737

3838
return { ...state, showBugtrackingNagscreen };

0 commit comments

Comments
 (0)