Skip to content

Commit

Permalink
fix: allow direct access to /receive/stx
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Oct 12, 2023
1 parent 65e8930 commit 8bff6a8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
20 changes: 20 additions & 0 deletions src/app/routes/app-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ function useAppRoutes() {
return createHashRouter(
createRoutesFromElements(
<Route element={<Container />}>
{/*
// going direct to /receive/stx doesn't work and thats what happens in Ledger mode
Adding this here makes it work going direct but then the BG isn't right
Review nesting of recieve as using these relative paths is stopping direct access
BUT we need to have relative paths from '/' if we want to overlay the modal
Direct access to ALL links actually doesn't work. Only through click!
FFS - /change-theme even doesn't work when pasted in.
Need to catch all these routes and set a BG location.
This will probably help fix things in new tabs also
The way it is now is shit as typing in URLs stops working
*/}
<Route
path={`/${RouteUrls.Receive}/${RouteUrls.ReceiveStx}`}
element={<ReceiveStxModal />}
/>
<Route
path={`${RouteUrls.Home}*`}
element={
Expand Down
2 changes: 1 addition & 1 deletion src/shared/crypto/bitcoin/bitcoin.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ interface GetTaprootAddressArgs {
network: BitcoinNetworkModes;
}
export function getTaprootAddress({ index, keychain, network }: GetTaprootAddressArgs) {
if (!keychain) throw new Error('Expected dddkeychain to be provided');
if (!keychain) throw new Error('Expected keychain to be provided');

if (keychain.depth !== DerivationPathDepth.Account)
throw new Error('Expects keychain to be on the account index');
Expand Down
5 changes: 1 addition & 4 deletions tests/page-object-models/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class HomePage {
}

async goToReceiveModal() {
PETE check this
await this.page.getByTestId(HomePageSelectors.ReceiveCryptoAssetBtn).click();
}

Expand Down Expand Up @@ -90,10 +89,8 @@ export class HomePage {
await this.goToReceiveModal();
// In Ledger mode, this element isn't visible, so clicking is conditional
const qrCodeBtn = this.page.getByTestId(HomePageSelectors.ReceiveStxQrCodeBtn);
debugger;

// THIS seems to run no matter whattttttt! maybe its goToReceiveModal crashing
if (false) await qrCodeBtn.click();
if (await qrCodeBtn.isVisible()) await qrCodeBtn.click();
const displayerAddress = await this.page
.getByTestId(SharedComponentsSelectors.AddressDisplayer)
.innerText();
Expand Down

0 comments on commit 8bff6a8

Please sign in to comment.