From 17901501c0936979b6325e8901891c193bd7c7f9 Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Wed, 1 Nov 2023 14:44:24 +0100 Subject: [PATCH] refactor: make status page params more readable --- src/views/Bridge/hooks/useBridgeAction.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/views/Bridge/hooks/useBridgeAction.ts b/src/views/Bridge/hooks/useBridgeAction.ts index 5a951ac1b..0b8c66257 100644 --- a/src/views/Bridge/hooks/useBridgeAction.ts +++ b/src/views/Bridge/hooks/useBridgeAction.ts @@ -103,12 +103,13 @@ export function useBridgeAction( ); }); + const statusPageSearchParams = new URLSearchParams({ + originChainId: String(frozenPayload.fromChain), + destinationChainId: String(frozenPayload.toChain), + bridgeTokenSymbol: tokenSymbol, + }).toString(); history.push( - `/bridge/${tx.hash}?${new URLSearchParams({ - originChainId: String(frozenPayload.fromChain), - destinationChainId: String(frozenPayload.toChain), - bridgeTokenSymbol: tokenSymbol, - }).toString()}`, + `/bridge/${tx.hash}?${statusPageSearchParams}`, // This state is stored in session storage and therefore persist // after a refresh of the deposit status page. {