feat: fix the problem of abnormal tour when refreshing (#3054)

* fix: fix the problem of abnormal tour when refreshing

* fix: change the way enableTour configuration is stored
This commit is contained in:
ZhaoYP 2001
2024-07-12 19:27:55 +08:00
committed by GitHub
parent 7f2869cecb
commit 4a3bd84f84
2 changed files with 9 additions and 4 deletions

View File

@ -203,9 +203,14 @@ export function getNextUrl(pathName = window.location.pathname) {
return TourUrlList[TourUrlList.indexOf(pathName.replace("/", "")) + 1] || "";
}
let orgIsTourVisible = true;
export function setOrgIsTourVisible(visible) {
orgIsTourVisible = visible;
}
export function setIsTourVisible(visible) {
localStorage.setItem("isTourVisible", visible);
window.dispatchEvent(new Event("storageTourChanged"));
}
export function setTourLogo(tourLogoSrc) {
@ -215,7 +220,7 @@ export function setTourLogo(tourLogoSrc) {
}
export function getTourVisible() {
return localStorage.getItem("isTourVisible") !== "false";
return localStorage.getItem("isTourVisible") !== "false" && orgIsTourVisible;
}
export function getNextButtonChild(nextPathName) {