From df66b569dd001ee41fde23d4b19fa09ebb8e1c38 Mon Sep 17 00:00:00 2001 From: vzhovnitsky Date: Tue, 24 Dec 2024 14:46:02 +0100 Subject: [PATCH 1/2] fix: holders queries invalidation & code cleanup --- app/components/products/ProductsComponent.tsx | 4 +--- app/engine/effects/onHoldersInvalidate.ts | 17 +++++++++++++++-- .../holders/HoldersLandingFragment.tsx | 4 +--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/components/products/ProductsComponent.tsx b/app/components/products/ProductsComponent.tsx index 8350c5f42..1a919f48c 100644 --- a/app/components/products/ProductsComponent.tsx +++ b/app/components/products/ProductsComponent.tsx @@ -20,16 +20,14 @@ import { useBanners } from "../../engine/hooks/banners" import { ProductAd } from "../../engine/api/fetchBanners" import { MixpanelEvent, trackEvent } from "../../analytics/mixpanel" import { AddressFormatUpdate } from "./AddressFormatUpdate" -import { TonProductComponent } from "./TonProductComponent" -import { SpecialJettonProduct } from "./SpecialJettonProduct" import { useIsHoldersInvited } from "../../engine/hooks/holders/useIsHoldersInvited" import { HoldersAppParamsType } from "../../fragments/holders/HoldersAppFragment" import { W5Banner } from "./W5Banner" import { HoldersCustomBanner } from "../../engine/api/holders/fetchAddressInviteCheck" import { HoldersBanner } from "./HoldersBanner" +import { SavingsProduct } from "./SavingsProduct" import OldWalletIcon from '@assets/ic_old_wallet.svg'; -import { SavingsProduct } from "./SavingsProduct" export type HoldersBannerType = { type: 'built-in' } | { type: 'custom', banner: HoldersCustomBanner }; diff --git a/app/engine/effects/onHoldersInvalidate.ts b/app/engine/effects/onHoldersInvalidate.ts index 7240a2672..df355fca1 100644 --- a/app/engine/effects/onHoldersInvalidate.ts +++ b/app/engine/effects/onHoldersInvalidate.ts @@ -1,8 +1,21 @@ import { Address } from "@ton/core"; import { queryClient } from "../clients"; -import { Queries } from "../queries"; export async function onHoldersInvalidate(account: string, isTestnet: boolean) { let address = Address.parse(account).toString({ testOnly: isTestnet }); - await queryClient.invalidateQueries(Queries.Holders(address).All()); + await queryClient.invalidateQueries({ + predicate: (query) => { + const queryKey = query.queryKey as string[]; + if (queryKey[0] === 'holders') { + const isAccountInQuery = queryKey[1] === address; + + if (queryKey[2] === 'invite') { + return false; + } + + return isAccountInQuery; + } + return false; + }, + }); } \ No newline at end of file diff --git a/app/fragments/holders/HoldersLandingFragment.tsx b/app/fragments/holders/HoldersLandingFragment.tsx index 45a20781c..535cee4cf 100644 --- a/app/fragments/holders/HoldersLandingFragment.tsx +++ b/app/fragments/holders/HoldersLandingFragment.tsx @@ -23,8 +23,6 @@ import { DAppWebView, DAppWebViewProps } from '../../components/webview/DAppWebV import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { getAppManifest } from '../../engine/getters/getAppManifest'; import { useActionSheet } from '@expo/react-native-action-sheet'; -import { queryClient } from '../../engine/clients'; -import { Queries } from '../../engine/queries'; import { MixpanelEvent, trackEvent } from '../../analytics/mixpanel'; import { AnimatedCards } from './components/AnimatedCards'; @@ -37,7 +35,7 @@ export const HoldersLandingFragment = fragment(() => { const { showActionSheetWithOptions } = useActionSheet(); const navigation = useTypedNavigation(); const safeArea = useSafeAreaInsets(); - const [currency,] = usePrimaryCurrency(); + const [currency] = usePrimaryCurrency(); const { endpoint, onEnrollType, inviteId } = useParams<{ endpoint: string, onEnrollType: HoldersAppParams, inviteId?: string }>(); From b51160663b11e8d02ba79c2fa3a41fb72cda8a6a Mon Sep 17 00:00:00 2001 From: vzhovnitsky Date: Tue, 24 Dec 2024 14:46:27 +0100 Subject: [PATCH 2/2] v2.4.11 --- VERSION_CODE | 2 +- ios/wallet/Info.plist | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION_CODE b/VERSION_CODE index b3b2268d2..d903d5972 100644 --- a/VERSION_CODE +++ b/VERSION_CODE @@ -1 +1 @@ -228 \ No newline at end of file +229 \ No newline at end of file diff --git a/ios/wallet/Info.plist b/ios/wallet/Info.plist index 525318b99..d23128344 100644 --- a/ios/wallet/Info.plist +++ b/ios/wallet/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 2.4.10 + 2.4.11 CFBundleSignature ???? CFBundleURLTypes @@ -42,7 +42,7 @@ CFBundleVersion - 228 + 229 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/package.json b/package.json index cd6ec04b2..8aa7cf8eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wallet", - "version": "2.4.10", + "version": "2.4.11", "scripts": { "start": "expo start --dev-client", "android": "expo run:android",