Skip to content

Commit

Permalink
Fix excessive loading time on new accounts (#3788)
Browse files Browse the repository at this point in the history
Fixes a case where a balance of zero would prevent loading from
finishing early and reduces the `initialLoad` timer to 90 seconds.

## To Test
- [ ] Do a fresh install and import or make a new account, popup
shouldn't remain stuck loading for 2 minutes

Latest build:
[extension-builds-3788](https://github.com/tahowallet/extension/suites/34873113422/artifacts/2650541060)
(as of Tue, 25 Feb 2025 18:02:31 GMT).
  • Loading branch information
Shadowfiend authored Feb 25, 2025
2 parents f4f8804 + d17760c commit fb01619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions background/redux-slices/selectors/accountsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { DOGGO } from "../../constants/assets"
import { FeatureFlags, isEnabled } from "../../features"
import { AccountSigner, SignerType } from "../../services/signing"
import { SignerImportSource } from "../../services/internal-signer"
import { assertUnreachable } from "../../lib/utils/type-guards"
import { assertUnreachable, isDefined } from "../../lib/utils/type-guards"
import { PricesState, selectAssetPricePoint } from "../prices"
import { TESTNET_TAHO } from "../../services/island"

Expand Down Expand Up @@ -264,7 +264,7 @@ export const selectAccountAndTimestampedActivities = createSelector(
return {
combinedData: {
assets: combinedAssetAmounts,
totalMainCurrencyValue: totalMainCurrencyAmount
totalMainCurrencyValue: isDefined(totalMainCurrencyAmount)
? formatCurrencyAmount(
mainCurrencySymbol,
totalMainCurrencyAmount,
Expand Down Expand Up @@ -317,7 +317,7 @@ export const selectCurrentAccountBalances = createSelector(
allAssetAmounts,
assetAmounts: combinedAssetAmounts,
unverifiedAssetAmounts,
totalMainCurrencyValue: totalMainCurrencyAmount
totalMainCurrencyValue: isDefined(totalMainCurrencyAmount)
? formatCurrencyAmount(
mainCurrencySymbol,
totalMainCurrencyAmount,
Expand Down
2 changes: 1 addition & 1 deletion background/services/redux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export default class ReduxService extends BaseService<never> {
) {
super({
initialLoadWaitExpired: {
schedule: { delayInMinutes: 2.5 },
schedule: { delayInMinutes: 1.5 },
handler: () => this.store.dispatch(initializationLoadingTimeHitLimit()),
},
})
Expand Down

0 comments on commit fb01619

Please sign in to comment.