Skip to content

Commit

Permalink
fix: fixed onboarding showing up even if cancelled
Browse files Browse the repository at this point in the history
- from now on progress and disabled tooltips are explicitly favored over whatever is present in the UI at any moment

Ticket: MEN-6748
Changelog: Title
Signed-off-by: Manuel Zedel <[email protected]>
  • Loading branch information
mzedel committed Sep 26, 2023
1 parent 22902dc commit 4818db0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/js/actions/onboardingActions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const defaultOnboardingState = {
deviceType: null,
progress: undefined,
showConnectDeviceDialog: false,
showTips: null,
showTips: undefined,
showTipsDialog: false,
something: 'here'
};
Expand Down
10 changes: 7 additions & 3 deletions src/js/selectors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
} from '../constants/deviceConstants';
import { READ_STATES, rolesByName, twoFAStates, uiPermissionsById } from '../constants/userConstants';
import { attributeDuplicateFilter, duplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper, versionCompare } from '../helpers';
import { onboardingSteps } from '../utils/onboardingmanager';

const getAppDocsVersion = state => state.app.docsVersion;
export const getFeatures = state => state.app.features;
Expand Down Expand Up @@ -238,9 +239,12 @@ export const getOfflineThresholdSettings = createSelector([getGlobalSettings], (
export const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({
...remainder,
...onboarding,
complete,
progress,
showTips
complete: onboarding.complete || complete,
progress:
Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)
? progress
: onboarding.progress,
showTips: !onboarding.showTips ? onboarding.showTips : showTips
}));

export const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>
Expand Down

0 comments on commit 4818db0

Please sign in to comment.