Skip to content

Commit

Permalink
Merge pull request #13227 from strapi/fix/guided-tour-localstorage
Browse files Browse the repository at this point in the history
[Fix] Guided tour skipped local storage
  • Loading branch information
ronronscelestes committed May 11, 2022
2 parents 63ecdae + 9e57778 commit 91bfab5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/helper-plugin/lib/src/utils/auth/index.js
Expand Up @@ -6,6 +6,7 @@ const TOKEN_KEY = 'jwtToken';
const USER_INFO = 'userInfo';
const CURRENT_STEP = 'GUIDED_TOUR_CURRENT_STEP';
const COMPLETED_STEPS = 'GUIDED_TOUR_COMPLETED_STEPS';
const SKIPPED = 'GUIDED_TOUR_SKIPPED';
const THEME_KEY = 'STRAPI_THEME'; // Also used in packages/core/admin/admin/src/components/ThemeToggleProvider/index.js

const parse = JSON.parse;
Expand All @@ -32,6 +33,7 @@ const auth = {
const localeLang = localStorage.getItem('strapi-admin-language');
const guidedTourCurrentStep = auth.get(CURRENT_STEP);
const guidedTourState = auth.get(COMPLETED_STEPS);
const guidedTourSkipped = parse(localStorage.getItem(SKIPPED));
const applicationTheme = localStorage.getItem(THEME_KEY);

localStorage.clear();
Expand All @@ -42,6 +44,7 @@ const auth = {
localStorage.setItem('strapi-admin-language', localeLang);
localStorage.setItem(CURRENT_STEP, stringify(guidedTourCurrentStep));
localStorage.setItem(COMPLETED_STEPS, stringify(guidedTourState));
localStorage.setItem(SKIPPED, stringify(guidedTourSkipped));
localStorage.setItem(THEME_KEY, applicationTheme);
}

Expand Down

0 comments on commit 91bfab5

Please sign in to comment.