Skip to content

Commit 062af96

Browse files
committed
fix: remove onboarding hash path on close in compact pagination
1 parent 21a9676 commit 062af96

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,14 @@ const Template: React.FC<ITemplate> = ({
147147
if (isOnboarding && location.hash.includes("#onboarding")) navigate("#", { replace: true });
148148
}, [location.hash, navigate, isOnboarding]);
149149

150+
const onCloseAndRemoveOnboardingHashPath = () => {
151+
onClose();
152+
removeOnboardingHashPath();
153+
};
154+
150155
useClickAway(containerRef, () => {
151156
if (canClose) {
152-
onClose();
153-
removeOnboardingHashPath();
157+
onCloseAndRemoveOnboardingHashPath();
154158
}
155159
});
156160

@@ -168,7 +172,7 @@ const Template: React.FC<ITemplate> = ({
168172
currentPage={currentPage}
169173
callback={setCurrentPage}
170174
numPages={numPages}
171-
onCloseOnLastPage={onClose}
175+
onCloseOnLastPage={onCloseAndRemoveOnboardingHashPath}
172176
label={`${currentPage}/${numPages}`}
173177
/>
174178
</LeftContainerHeader>
@@ -177,7 +181,7 @@ const Template: React.FC<ITemplate> = ({
177181
currentPage={currentPage}
178182
callback={setCurrentPage}
179183
numPages={numPages}
180-
onCloseOnLastPage={onClose}
184+
onCloseOnLastPage={onCloseAndRemoveOnboardingHashPath}
181185
label={`${currentPage}/${numPages}`}
182186
/>
183187
</LeftContainer>

0 commit comments

Comments
 (0)