mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-08 12:11:03 +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) {
|
export function setOrgIsTourVisible(visible) {
|
||||||
orgIsTourVisible = visible;
|
orgIsTourVisible = visible;
|
||||||
|
if (orgIsTourVisible === false) {
|
||||||
|
setIsTourVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setIsTourVisible(visible) {
|
export function setIsTourVisible(visible) {
|
||||||
localStorage.setItem("isTourVisible", visible);
|
localStorage.setItem("isTourVisible", visible);
|
||||||
|
window.dispatchEvent(new Event("storageTourChanged"));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setTourLogo(tourLogoSrc) {
|
export function setTourLogo(tourLogoSrc) {
|
||||||
@@ -221,7 +225,7 @@ export function setTourLogo(tourLogoSrc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getTourVisible() {
|
export function getTourVisible() {
|
||||||
return localStorage.getItem("isTourVisible") !== "false" && orgIsTourVisible;
|
return localStorage.getItem("isTourVisible") !== "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getNextButtonChild(nextPathName) {
|
export function getNextButtonChild(nextPathName) {
|
||||||
|
@@ -31,17 +31,11 @@ class OpenTour extends React.Component {
|
|||||||
return TourConfig.TourUrlList.indexOf(path) !== -1 || path === "";
|
return TourConfig.TourUrlList.indexOf(path) !== -1 || path === "";
|
||||||
};
|
};
|
||||||
|
|
||||||
handleTourClick = () => {
|
|
||||||
TourConfig.setIsTourVisible(true);
|
|
||||||
const event = new Event("storageTourChanged");
|
|
||||||
window.dispatchEvent(event);
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
this.canTour() ?
|
this.canTour() ?
|
||||||
<Tooltip title="Click to open tour">
|
<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"}} />
|
<QuestionCircleOutlined style={{fontSize: "24px"}} />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
Reference in New Issue
Block a user