Skip to content

Commit

Permalink
fix: empty state for new tokens (#633)
Browse files Browse the repository at this point in the history
* fix empty state for new tokens

* use lambda

---------

Co-authored-by: Andrey Malochka <[email protected]>
  • Loading branch information
AndreyMolochko and Andrey Malochka authored Nov 20, 2024
1 parent f49898b commit cf10b21
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,14 @@
"manualBackupTitleDialog": "Manual backup",
"manualBackupSubtitleDialog": "Save your secret recovery phrase in a secure place that only you control.",
"createNewAccount": "Create new account",
"addExternalAccount": "Add an external account",
"addExternalAccount": "Add an external account (soon)",
"confirmAction": "Confirm action",
"enterYourPassword": "Enter your password",
"useFaceID": "Use Face ID",
"useFingerprint": "Use Fingerprint",
"accountName": "Account name",
"defaultWord": "Default",
"multisignatureWord": "Multi Signature",
"multisignatureWord": "Multi-Signature",
"forExperiencedUsers": "For experienced users",
"walletDescriptionSurfWallet": "Wallet contract used in Surf. Requires deployment.",
"walletDescriptionWalletV3": "Small legacy contract with one custodian. Deploys automatically.",
Expand Down
4 changes: 2 additions & 2 deletions assets/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,14 @@
"manualBackupTitleDialog": "Manual backup",
"manualBackupSubtitleDialog": "Save your secret recovery phrase in a secure place that only you control.",
"createNewAccount": "Create new account",
"addExternalAccount": "Add an external account",
"addExternalAccount": "Add an external account (soon)",
"confirmAction": "Confirm action",
"enterYourPassword": "Enter your password",
"useFaceID": "Use Face ID",
"useFingerprint": "Use Fingerprint",
"accountName": "Account name",
"defaultWord": "Default",
"multisignatureWord": "Multi Signature",
"multisignatureWord": "Multi-Signature",
"forExperiencedUsers": "For experienced users",
"walletDescriptionSurfWallet": "Wallet contract used in Surf. Requires deployment.",
"walletDescriptionWalletV3": "Small legacy contract with one custodian. Deploys automatically.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AccountAssetsTab extends StatelessWidget {
isShowingNewTokens: isShowingNewTokens,
confirmImportCallback: confirmImportCallback,
numberNewTokens: state.when(
empty: () => 0,
empty: () => null,
accounts: (_, __, newTokens) => newTokens,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ class AccountAssetTabCubit extends Cubit<AccountAssetTabState> {
);
});

if (isShowingNewTokens) {
_searchSubscription = tokenWalletsService
.searchTokenWalletsForAddress(tonWallet.address)
.reduce((previous, element) => [...previous, ...element])
.asStream()
.listen(
(value) => _updateAccounts(value.length),
onError: (_) => _updateAccounts(0),
);
}
_searchSubscription = tokenWalletsService
.searchTokenWalletsForAddress(tonWallet.address)
.reduce((previous, element) => [...previous, ...element])
.asStream()
.listen(
(value) => _updateAccounts(value.length),
onError: (_) => _updateAccounts(0),
);
}

final AssetsService assetsService;
Expand Down

0 comments on commit cf10b21

Please sign in to comment.