Skip to content

Commit

Permalink
fix tests bis
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut committed Nov 3, 2023
1 parent f976561 commit e33ebd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions packages/ui/cypress/tests/watched-accounts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
12 changes: 7 additions & 5 deletions packages/ui/src/contexts/MultiProxyContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const MultiProxyContextProvider = ({ children }: MultisigContextProps) => {
const multiProxyList = useMemo(() => {
return [...(pureProxyList || []), ...(multisigList || [])]
}, [multisigList, pureProxyList])

const selectedMultiProxyAddress = useMemo(
() => getMultiProxyAddress(selectedMultiProxy),
[selectedMultiProxy]
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit e33ebd2

Please sign in to comment.