From 7a85b745734747421fba5e4c2686fa6a7301568e Mon Sep 17 00:00:00 2001 From: Baihhh <63110802+Baihhh@users.noreply.github.com> Date: Sun, 27 Aug 2023 23:18:14 +0800 Subject: [PATCH] fix: fix tour disabled state (#2264) * fix: distinguish between pages that can tour or not * Update OpenTour.js --------- Co-authored-by: hsluoyz --- web/src/common/OpenTour.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/web/src/common/OpenTour.js b/web/src/common/OpenTour.js index 80d0a0be..ff42d7c0 100644 --- a/web/src/common/OpenTour.js +++ b/web/src/common/OpenTour.js @@ -26,13 +26,23 @@ class OpenTour extends React.Component { }; } + canTour = () => { + const path = window.location.pathname.replace("/", ""); + return TourConfig.TourUrlList.indexOf(path) !== -1 || path === ""; + }; + render() { return ( - -
TourConfig.setIsTourVisible(true)} > - + this.canTour() ? + +
TourConfig.setIsTourVisible(true)} > + +
+
+ : +
+
- ); } }