From e33ebd2a584314cc0883c17f54675f9e517bd071 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Fri, 3 Nov 2023 11:46:22 +0000 Subject: [PATCH] fix tests bis --- packages/ui/cypress/tests/watched-accounts.cy.ts | 4 +--- packages/ui/src/contexts/MultiProxyContext.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/ui/cypress/tests/watched-accounts.cy.ts b/packages/ui/cypress/tests/watched-accounts.cy.ts index 4c2399c3..345ab260 100644 --- a/packages/ui/cypress/tests/watched-accounts.cy.ts +++ b/packages/ui/cypress/tests/watched-accounts.cy.ts @@ -142,14 +142,12 @@ describe('Watched Accounts', () => { const { name: pureName, purePublicKey } = watchMultisigs['multisig-with-pure'] cy.visitWithLocalStorage({ - url: settingsPageWatchAccountUrl, + url: landingPageUrl, accountNames: { [purePublicKey]: pureName }, watchedAccounts: [purePublicKey] }) - // navigate to the home page and edit the name - topMenuItems.homeButton().click() multisigPage.optionsMenuButton().click() multisigPage.editNamesMenuOption().click() editNamesModal.body().should('be.visible') diff --git a/packages/ui/src/contexts/MultiProxyContext.tsx b/packages/ui/src/contexts/MultiProxyContext.tsx index 4d0c1638..34c500d5 100644 --- a/packages/ui/src/contexts/MultiProxyContext.tsx +++ b/packages/ui/src/contexts/MultiProxyContext.tsx @@ -69,7 +69,6 @@ const MultiProxyContextProvider = ({ children }: MultisigContextProps) => { const multiProxyList = useMemo(() => { return [...(pureProxyList || []), ...(multisigList || [])] }, [multisigList, pureProxyList]) - const selectedMultiProxyAddress = useMemo( () => getMultiProxyAddress(selectedMultiProxy), [selectedMultiProxy] @@ -115,7 +114,9 @@ const MultiProxyContextProvider = ({ children }: MultisigContextProps) => { if (!!data?.accountMultisigs && data.accountMultisigs.length === 0) { setPureToQuery([]) setMultisigList([]) - setPureProxyList([]) + // watched addresses are part of the pure to query + // only signal we're done querying if there are no watched addresses + watchedAddresses.length === 0 && setPureProxyList([]) } if (!!data?.accountMultisigs && data.accountMultisigs.length > 0) { @@ -156,14 +157,15 @@ const MultiProxyContextProvider = ({ children }: MultisigContextProps) => { // add the selection to the pure to query setPureToQuery(Array.from(pureToQuerySet)) - // if there is nothing to query set the list to empty + + // if there is no pure to query set the PureProxyList to empty array // to signify that the pure proxies are done loading - pureToQuerySet.size === 0 && setPureProxyList([]) + pureToQuerySet.size === 0 && watchedAddresses.length === 0 && setPureProxyList([]) } setIsRefreshingMultiProxyList(false) }, - [] + [watchedAddresses] ) const refreshWatchedPureList = useCallback((data: PureByIdsSubscription | null) => {