Skip to content

Commit

Permalink
fix: fix the issue where data does not update after entering the stak…
Browse files Browse the repository at this point in the history
…ing history details page. (#6368)
  • Loading branch information
huhuanming authored Dec 18, 2024
1 parent 650f508 commit bda3c03
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
4 changes: 1 addition & 3 deletions packages/kit-bg/src/vaults/impls/ltc/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const accountDeriveInfo: IAccountDeriveInfoMapLtc = {
coinType: COINTYPE_LTC,
coinName: COINNAME_LTC,
label: 'Legacy',
desc: `${appLocale.intl.formatMessage({
id: ETranslations.litecoin_legacy_desc,
})} BIP44, P2PKH, Base58`,
desc: ETranslations.litecoin_legacy_desc,
addressEncoding: EAddressEncodings.P2PKH,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ function HistoryDetails() {
overrideIsFocused: (isPageFocused) =>
isPageFocused &&
(!historyInit.current ||
(historyTxParam?.decodedTx.status === EDecodedTxStatus.Pending &&
((historyTxParam?.decodedTx.status ?? EDecodedTxStatus.Pending) ===
EDecodedTxStatus.Pending &&
!historyConfirmed.current)),
},
);
Expand Down
8 changes: 4 additions & 4 deletions packages/kit/src/views/Market/components/MarketMore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,22 @@ function BasicMarketMore({
},
] as IActionListItemProps[],
},
isSupportBuy && show
show
? {
items: [
{
icon: 'MinusLargeSolid',
label: intl.formatMessage({ id: ETranslations.global_sell }),
onPress: tradeActions.onSell,
disabled: !isSupportBuy,
},
] as IActionListItemProps[],
}
: undefined,
].filter(Boolean),
[MoveToTop, intl, isSupportBuy, show, showMoreAction, tradeActions.onSell],
);
return sections.length ? (
return (
<ActionList
title=""
renderTrigger={
Expand All @@ -67,13 +68,12 @@ function BasicMarketMore({
icon="DotVerSolid"
variant="tertiary"
iconSize="$5"
disabled={sections.length === 0}
{...props}
/>
}
sections={sections}
/>
) : (
<Stack w="$5" />
);
}

Expand Down
6 changes: 5 additions & 1 deletion packages/kit/src/views/Market/components/TokenPriceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ const useHeight = () => {

const tabHeight = useTabBarHeight();
const fixedHeight = useMemo(() => {
if (platformEnv.isNative) {
if (platformEnv.isNativeIOS) {
return 268;
}

if (platformEnv.isNativeAndroid) {
return 258;
}

return 300;
}, []);
return useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function AlertSection({ alerts = [] }: { alerts?: string[] }) {
bg="$bgSubdued"
borderColor="$borderSubdued"
borderWidth={StyleSheet.hairlineWidth}
borderRadius="$3"
py="$3.5"
px="$4"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Button,
Divider,
NumberSizeableText,
Progress,
SizableText,
XStack,
YStack,
Expand All @@ -16,6 +15,8 @@ import { useSettingsPersistAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms'
import { ETranslations } from '@onekeyhq/shared/src/locale';
import type { IStakeProtocolDetails } from '@onekeyhq/shared/types/staking';

import { AlertSection } from './AlertSection';

type IStakedValueInfoProps = {
value: number;
stakedNumber: number;
Expand Down Expand Up @@ -85,10 +86,12 @@ export const StakedValueSection = ({
details,
stakeButtonProps,
withdrawButtonProps,
alerts = [],
}: {
details?: IStakeProtocolDetails;
stakeButtonProps?: ComponentProps<typeof Button>;
withdrawButtonProps?: ComponentProps<typeof Button>;
alerts?: string[];
}) => {
if (!details) {
return null;
Expand All @@ -106,7 +109,7 @@ export const StakedValueSection = ({
stakeButtonProps={stakeButtonProps}
withdrawButtonProps={withdrawButtonProps}
/>

<AlertSection alerts={alerts} />
<Divider />
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
isLoadingState,
} from '../../components/PageFrame';
import { ProtocolDetails } from '../../components/ProtocolDetails';
import { AlertSection } from '../../components/ProtocolDetails/AlertSection';
import { NoAddressWarning } from '../../components/ProtocolDetails/NoAddressWarning';
import { PortfolioSection } from '../../components/ProtocolDetails/PortfolioSection';
import { StakedValueSection } from '../../components/ProtocolDetails/StakedValueSection';
Expand Down Expand Up @@ -295,8 +294,8 @@ const ProtocolDetailsPage = () => {
details={result}
stakeButtonProps={stakeButtonProps}
withdrawButtonProps={withdrawButtonProps}
alerts={result?.provider.alerts}
/>
<AlertSection alerts={result?.provider.alerts} />
<PortfolioSection
details={result}
onClaim={onClaim}
Expand Down

0 comments on commit bda3c03

Please sign in to comment.