diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 1430e14a7f4..879eac6a136 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -6,9 +6,11 @@ env: on: push: - branches: [dev] + branches: + - gh-readonly-queue/dev/** pull_request: - branches: [dev] + branches: + - dev jobs: test: diff --git a/src/app/common/hooks/analytics/transactions-analytics.hooks.ts b/src/app/common/hooks/analytics/transactions-analytics.hooks.ts deleted file mode 100644 index 6702512b173..00000000000 --- a/src/app/common/hooks/analytics/transactions-analytics.hooks.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { useEffect, useMemo } from 'react'; - -import { AccountStxBalanceBigNumber } from '@shared/models/account.model'; - -import { useCurrentStacksAccountUnanchoredBalances } from '@app/query/stacks/balance/stx-balance.hooks'; -import { store } from '@app/store'; -import { analyticsActions } from '@app/store/analytics/analytics.actions'; -import { useAnalyticsHasStxDeposits } from '@app/store/analytics/analytics.selectors'; -import { useCurrentNetworkState } from '@app/store/networks/networks.hooks'; - -import { useAnalytics } from './use-analytics'; - -function useIsFirstDeposit(stxBalance: AccountStxBalanceBigNumber | undefined): boolean { - const currentNetwork = useCurrentNetworkState(); - const { chainId: stxChainId } = currentNetwork.chain.stacks; - const hasStxDeposits = useAnalyticsHasStxDeposits()[stxChainId]; - const hasZeroStx = useMemo( - () => stxBalance?.total_received.amount?.isEqualTo(0) || false, - [stxBalance?.total_received] - ); - useEffect(() => { - if (!stxBalance) return; - if (hasZeroStx || !hasStxDeposits) { - store.dispatch( - analyticsActions.hasStxDeposits({ - network: stxChainId, - hasStxDeposits: !hasZeroStx, - }) - ); - } - }, [hasZeroStx, hasStxDeposits, stxChainId, stxBalance]); - return !hasStxDeposits && !hasZeroStx; -} - -export function useTrackFirstDeposit() { - const analytics = useAnalytics(); - const { data: balances } = useCurrentStacksAccountUnanchoredBalances(); - const firstDeposit = useIsFirstDeposit(balances?.stx); - useEffect(() => { - if (!firstDeposit || !balances) return; - void analytics.track('deposit_first_stx', { type: 'stx' }); - }, [analytics, balances, firstDeposit]); -} diff --git a/src/app/components/request-password.tsx b/src/app/components/request-password.tsx index 1cca4ecdea0..c9c42010869 100644 --- a/src/app/components/request-password.tsx +++ b/src/app/components/request-password.tsx @@ -62,7 +62,7 @@ export function RequestPassword({ title, caption, onSuccess }: RequestPasswordPr > {title} - + {(isRunning && waitingMessage) || caption} @@ -78,7 +78,7 @@ export function RequestPassword({ title, caption, onSuccess }: RequestPasswordPr > Your password - + - {error && {error}} + {error && {error}} - {leftColumn} + + {leftColumn} + diff --git a/src/app/pages/onboarding/set-password/components/password-field.tsx b/src/app/pages/onboarding/set-password/components/password-field.tsx index d2944b07ad6..ffdb59c97fb 100644 --- a/src/app/pages/onboarding/set-password/components/password-field.tsx +++ b/src/app/pages/onboarding/set-password/components/password-field.tsx @@ -70,7 +70,7 @@ export function PasswordField({ strengthResult, isDisabled }: PasswordFieldProps strengthResult={strengthResult} /> - Password strength: + Password strength: {field.value ? strengthText : '—'} diff --git a/src/app/query/stacks/balance/stx-balance.hooks.ts b/src/app/query/stacks/balance/stx-balance.hooks.ts index cb22ed8bf47..e5076ddbc95 100644 --- a/src/app/query/stacks/balance/stx-balance.hooks.ts +++ b/src/app/query/stacks/balance/stx-balance.hooks.ts @@ -10,10 +10,7 @@ import { Money, createMoney } from '@shared/models/money.model'; import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks'; import { accountBalanceStxKeys } from '@app/store/accounts/blockchain/stacks/stacks-account.models'; -import { - useAnchoredStacksAccountBalanceQuery, - useUnanchoredStacksAccountBalanceQuery, -} from './stx-balance.query'; +import { useAnchoredStacksAccountBalanceQuery } from './stx-balance.query'; export function parseBalanceResponse(balances: AddressBalanceResponse) { const stxMoney = Object.fromEntries( @@ -33,17 +30,6 @@ export function parseBalanceResponse(balances: AddressBalanceResponse) { return { ...balances, stx }; } -function useUnanchoredStacksBalances(address: string) { - return useUnanchoredStacksAccountBalanceQuery(address, { - select: resp => parseBalanceResponse(resp), - }); -} - -export function useCurrentStacksAccountUnanchoredBalances() { - const account = useCurrentStacksAccount(); - return useUnanchoredStacksBalances(account?.address ?? ''); -} - export function useAnchoredStacksAccountBalances(address: string) { return useAnchoredStacksAccountBalanceQuery(address, { select: resp => parseBalanceResponse(resp), diff --git a/src/app/store/analytics/analytics.actions.ts b/src/app/store/analytics/analytics.actions.ts deleted file mode 100644 index 94da29ab5f2..00000000000 --- a/src/app/store/analytics/analytics.actions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { analyticsSlice } from './analytics.slice'; - -export const analyticsActions = analyticsSlice.actions; diff --git a/src/app/store/analytics/analytics.selectors.ts b/src/app/store/analytics/analytics.selectors.ts deleted file mode 100644 index f8e112aec09..00000000000 --- a/src/app/store/analytics/analytics.selectors.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { useSelector } from 'react-redux'; - -import { createSelector } from '@reduxjs/toolkit'; - -import { RootState } from '@app/store'; - -const selectAnalytics = (state: RootState) => state.analytics; - -const selectHasStxDeposits = createSelector(selectAnalytics, state => state.hasStxDeposits); - -export function useAnalyticsHasStxDeposits() { - return useSelector(selectHasStxDeposits); -} diff --git a/src/app/store/analytics/analytics.slice.ts b/src/app/store/analytics/analytics.slice.ts deleted file mode 100644 index 81c5d6f5347..00000000000 --- a/src/app/store/analytics/analytics.slice.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { PayloadAction, createSlice } from '@reduxjs/toolkit'; -import { ChainID } from '@stacks/common'; - -interface AnalyticsState { - hasStxDeposits: { - [ChainID.Mainnet]: boolean; - [ChainID.Testnet]: boolean; - }; -} - -const initialState: AnalyticsState = { - hasStxDeposits: { - [ChainID.Mainnet]: true, - [ChainID.Testnet]: true, - }, -}; - -interface DepositByNetwork { - hasStxDeposits: boolean; - network: ChainID; -} - -export const analyticsSlice = createSlice({ - name: 'analytics', - initialState, - reducers: { - hasStxDeposits(state, action: PayloadAction) { - const { network, hasStxDeposits } = action.payload; - state.hasStxDeposits[network] = hasStxDeposits; - }, - }, -}); diff --git a/src/app/store/index.ts b/src/app/store/index.ts index b39675a7f45..b74d517dbaf 100644 --- a/src/app/store/index.ts +++ b/src/app/store/index.ts @@ -17,7 +17,6 @@ import { PersistPartial } from 'redux-persist/es/persistReducer'; import { persistConfig } from '@shared/storage/redux-pesist'; -import { analyticsSlice } from './analytics/analytics.slice'; import { appPermissionsSlice } from './app-permissions/app-permissions.slice'; import { stxChainSlice } from './chains/stx-chain.slice'; import { inMemoryKeySlice } from './in-memory-key/in-memory-key.slice'; @@ -31,7 +30,6 @@ import { submittedTransactionsSlice } from './submitted-transactions/submitted-t import { broadcastActionTypeToOtherFramesMiddleware } from './utils/broadcast-action-types'; export interface RootState { - analytics: ReturnType; appPermissions: ReturnType; chains: { stx: ReturnType; @@ -49,7 +47,6 @@ export interface RootState { } const appReducer = combineReducers({ - analytics: analyticsSlice.reducer, appPermissions: appPermissionsSlice.reducer, chains: combineReducers({ stx: stxChainSlice.reducer, diff --git a/tests/page-object-models/onboarding.page.ts b/tests/page-object-models/onboarding.page.ts index f230915b6bd..a7260550a61 100644 --- a/tests/page-object-models/onboarding.page.ts +++ b/tests/page-object-models/onboarding.page.ts @@ -9,7 +9,6 @@ const TEST_ACCOUNT_SECRET_KEY = process.env.TEST_ACCOUNT_SECRET_KEY ?? ''; // If default wallet state changes, we'll need to update this export const testSoftwareAccountDefaultWalletState = { - analytics: { hasStxDeposits: { '1': true, '2147483648': true } }, chains: { stx: { default: { highestAccountIndex: 1, currentAccountIndex: 0 } } }, softwareKeys: { ids: ['default'], @@ -49,7 +48,6 @@ export const testSoftwareAccountDefaultWalletState = { const testLedgerAccountDefaultWalletState = { _persist: { rehydrated: true, version: 2 }, - analytics: { hasStxDeposits: { '1': false, '2147483648': true } }, chains: { stx: { default: { currentAccountIndex: 0, highestAccountIndex: 0 } } }, softwareKeys: { entities: {},