Skip to content

Commit 5992fbb

Browse files
committed
fix(routing): add check for empty hash route
1 parent 25f02c4 commit 5992fbb

File tree

1 file changed

+12
-5
lines changed
  • packages/blockchain-wallet-v4-frontend/src/scenes

1 file changed

+12
-5
lines changed

packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ const excludedStaging = [
149149
'/exchange',
150150
// '/prove/instant-link/callback',
151151
// '/refer',
152-
153152
// '/#/verify-email',
154153
'/#/login?product=exchange',
155154
'/wallet-options-v4.json',
@@ -221,10 +220,18 @@ const App = ({
221220
setDynamicRoutingState(false)
222221
return
223222
}
224-
225-
// OBTAIN FULL PATH BY COMBINING PATHNAME AND HASH (CLIENT-ONLY ROUTING)
226-
let fullPath = (window.location.pathname + window.location.hash).toLowerCase()
227-
const fullPathCaseSensitive = window.location.pathname + window.location.hash
223+
let fullPath
224+
let fullPathCaseSensitive
225+
if (window.location.hash && window.location.hash !== '#/') {
226+
// OBTAIN FULL PATH BY COMBINING PATHNAME AND HASH (CLIENT-ONLY ROUTING)
227+
fullPath = (window.location.pathname + window.location.hash).toLowerCase()
228+
fullPathCaseSensitive = window.location.pathname + window.location.hash
229+
} else {
230+
// OBTAIN FULL PATH BY COMBINING PATHNAME AND SEARCH QUERY, TO DEAL WITH HASH ROUTING
231+
// ADDING HASH AT THE END OF THE PATH IF THERE ISN'T ONE
232+
fullPath = (window.location.pathname + window.location.search).toLowerCase()
233+
fullPathCaseSensitive = window.location.pathname + window.location.search
234+
}
228235

229236
// SPLIT IT INTO PARTS TO HANDLE LANGUAGE DETECTION
230237
const pathSegments = fullPath.split('/').filter(Boolean)

0 commit comments

Comments
 (0)