diff --git a/cashtab/src/components/AppModes/Extension.js b/cashtab/src/components/AppModes/Extension.js --- a/cashtab/src/components/AppModes/Extension.js +++ b/cashtab/src/components/AppModes/Extension.js @@ -86,19 +86,24 @@ useEffect(() => { // On load - // Parse for query string asking for user approval of sharing extension info with a web page - // Do not set txInfo in state if query strings are not present if ( !window.location || !window.location.hash || - window.location.hash === '#/wallet' + window.location.hash === '#/wallet' || + window.location.hash === '#' ) { + // If we do not have window.location.hash + // or if it is at the legacy home page with nothing but the legacy home route + // or if it is at the new home route + // do nothing return; } try { let windowHash = window.location.hash; - let queryStringArray = windowHash.split('#/wallet?'); + let queryStringArray = windowHash.includes('#/wallet?') + ? windowHash.split('#/wallet?') + : windowHash.split('#/?'); let queryString = queryStringArray[1]; let queryStringParams = new URLSearchParams(queryString); let request = queryStringParams.get('request'); diff --git a/cashtab/src/components/Send/SendXec.js b/cashtab/src/components/Send/SendXec.js --- a/cashtab/src/components/Send/SendXec.js +++ b/cashtab/src/components/Send/SendXec.js @@ -167,6 +167,7 @@ const SendXec = () => { const ContextValue = React.useContext(WalletContext); const location = useLocation(); + console.log(`location`, location); const { chaintipBlockheight, fiatPrice, apiError, cashtabState, chronik } = ContextValue; const { settings, wallets } = cashtabState; diff --git a/cashtab/src/index.js b/cashtab/src/index.js --- a/cashtab/src/index.js +++ b/cashtab/src/index.js @@ -6,7 +6,7 @@ import { createRoot } from 'react-dom/client'; import App from 'components/App/App'; import { WalletProvider } from 'wallet/context'; -import { HashRouter as Router } from 'react-router-dom'; +import { BrowserRouter, HashRouter } from 'react-router-dom'; import GA from 'components/Common/GoogleAnalytics'; import { ChronikClientNode } from 'chronik-client'; import { chronik as chronikConfig } from 'config/chronik'; @@ -16,10 +16,16 @@ const root = createRoot(container); root.render( - - {GA.init() && } - - + {process.env.REACT_APP_BUILD_ENV === 'extension' ? ( + + + + ) : ( + + {GA.init() && } + + + )} , );