Skip to content

Commit

Permalink
Merge pull request mendersoftware#4046 from mzedel/men-6748
Browse files Browse the repository at this point in the history
MEN-6748 - fix: fixed onboarding showing up even if cancelled
  • Loading branch information
mzedel committed Oct 2, 2023
2 parents 05601b3 + 4818db0 commit 3ca6971
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 3ca6971

Please sign in to comment.