mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-06 09:50:28 +08:00
feat: fix tour bug about orgIsTourVisible settings (#3965)
This commit is contained in:
@@ -208,10 +208,14 @@ let orgIsTourVisible = true;
|
||||
|
||||
export function setOrgIsTourVisible(visible) {
|
||||
orgIsTourVisible = visible;
|
||||
if (orgIsTourVisible === false) {
|
||||
setIsTourVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
export function setIsTourVisible(visible) {
|
||||
localStorage.setItem("isTourVisible", visible);
|
||||
window.dispatchEvent(new Event("storageTourChanged"));
|
||||
}
|
||||
|
||||
export function setTourLogo(tourLogoSrc) {
|
||||
@@ -221,7 +225,7 @@ export function setTourLogo(tourLogoSrc) {
|
||||
}
|
||||
|
||||
export function getTourVisible() {
|
||||
return localStorage.getItem("isTourVisible") !== "false" && orgIsTourVisible;
|
||||
return localStorage.getItem("isTourVisible") !== "false";
|
||||
}
|
||||
|
||||
export function getNextButtonChild(nextPathName) {
|
||||
|
@@ -31,17 +31,11 @@ class OpenTour extends React.Component {
|
||||
return TourConfig.TourUrlList.indexOf(path) !== -1 || path === "";
|
||||
};
|
||||
|
||||
handleTourClick = () => {
|
||||
TourConfig.setIsTourVisible(true);
|
||||
const event = new Event("storageTourChanged");
|
||||
window.dispatchEvent(event);
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
this.canTour() ?
|
||||
<Tooltip title="Click to open tour">
|
||||
<div className="select-box" style={{display: Setting.isMobile() ? "none" : null, ...this.props.style}} onClick={this.handleTourClick}>
|
||||
<div className="select-box" style={{display: Setting.isMobile() ? "none" : null, ...this.props.style}} onClick={() => TourConfig.setIsTourVisible(true)} >
|
||||
<QuestionCircleOutlined style={{fontSize: "24px"}} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
Reference in New Issue
Block a user