Skip to content

Commit

Permalink
Revert "oct-1043: pending transaction loader - filter"
Browse files Browse the repository at this point in the history
This reverts commit d1c6714.
  • Loading branch information
aziolek committed Mar 28, 2024
1 parent 7dea9fa commit 5073dfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
19 changes: 5 additions & 14 deletions client/src/components/Earn/EarnBoxGlmLock/EarnBoxGlmLock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,9 @@ const EarnBoxGlmLock: FC<EarnBoxGlmLockProps> = ({ classNameBox }) => {
keyPrefix: 'components.dedicated.boxGlmLock',
});
const { isConnected } = useAccount();
const { isAppWaitingForTransactionToBeIndexed, transactionsPending } = useTransactionLocalStore(
state => ({
isAppWaitingForTransactionToBeIndexed: state.data.isAppWaitingForTransactionToBeIndexed,
transactionsPending: state.data.transactionsPending,
}),
);

const isPendingLockingOrUnlockingTransaction =
isAppWaitingForTransactionToBeIndexed &&
!!transactionsPending?.filter(
({ type, isFinalized }) => (type === 'lock' || 'unlock') && !isFinalized,
).length;
const { isAppWaitingForTransactionToBeIndexed } = useTransactionLocalStore(state => ({
isAppWaitingForTransactionToBeIndexed: state.data.isAppWaitingForTransactionToBeIndexed,
}));

const [isModalGlmLockOpen, setIsModalGlmLockOpen] = useState<boolean>(false);
const { data: estimatedEffectiveDeposit, isFetching: isFetchingEstimatedEffectiveDeposit } =
Expand All @@ -52,7 +43,7 @@ const EarnBoxGlmLock: FC<EarnBoxGlmLockProps> = ({ classNameBox }) => {
doubleValueProps: {
cryptoCurrency: 'golem',
dataTest: 'BoxGlmLock__Section--current__DoubleValue',
isFetching: isFetchingDepositValue || isPendingLockingOrUnlockingTransaction,
isFetching: isFetchingDepositValue || isAppWaitingForTransactionToBeIndexed,
valueCrypto: depositsValue,
},
isDisabled: isPreLaunch && !isConnected,
Expand All @@ -64,7 +55,7 @@ const EarnBoxGlmLock: FC<EarnBoxGlmLockProps> = ({ classNameBox }) => {
coinPricesServerDowntimeText: '...',
cryptoCurrency: 'golem',
dataTest: 'BoxGlmLock__Section--effective__DoubleValue',
isFetching: isFetchingEstimatedEffectiveDeposit || isPendingLockingOrUnlockingTransaction,
isFetching: isFetchingEstimatedEffectiveDeposit || isAppWaitingForTransactionToBeIndexed,
valueCrypto: estimatedEffectiveDeposit,
},
isDisabled: isPreLaunch && !isConnected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,9 @@ const EarnBoxPersonalAllocation: FC<EarnBoxPersonalAllocationProps> = ({ classNa
const { data: isPatronMode } = useIsPatronMode();
const { data: totalPatronDonations, isFetching: isFetchingTotalPatronDonations } =
useTotalPatronDonations({ isEnabledAdditional: !!isPatronMode });
const { isAppWaitingForTransactionToBeIndexed, transactionsPending } = useTransactionLocalStore(
state => ({
isAppWaitingForTransactionToBeIndexed: state.data.isAppWaitingForTransactionToBeIndexed,
transactionsPending: state.data.transactionsPending,
}),
);

const isPendingWithdrawalTransaction =
isAppWaitingForTransactionToBeIndexed &&
!!transactionsPending?.filter(({ type, isFinalized }) => type === 'withdrawal' && !isFinalized)
.length;
const { isAppWaitingForTransactionToBeIndexed } = useTransactionLocalStore(state => ({
isAppWaitingForTransactionToBeIndexed: state.data.isAppWaitingForTransactionToBeIndexed,
}));

const isPreLaunch = getIsPreLaunch(currentEpoch);
const isProjectAdminMode = useIsProjectAdminMode();
Expand Down Expand Up @@ -99,9 +91,7 @@ const EarnBoxPersonalAllocation: FC<EarnBoxPersonalAllocationProps> = ({ classNa
coinPricesServerDowntimeText: !isProjectAdminMode ? '...' : undefined,
cryptoCurrency: 'ethereum',
dataTest: 'BoxPersonalAllocation__Section--availableNow__DoubleValue',
isFetching: isPatronMode
? isFetchingTotalPatronDonations
: isFetchingWithdrawals || isPendingWithdrawalTransaction,
isFetching: isPatronMode ? isFetchingTotalPatronDonations : isFetchingWithdrawals,
valueCrypto: isPatronMode ? totalPatronDonations?.value : withdrawals?.sums.available,
},
label: isPatronMode && !isProjectAdminMode ? t('allTime') : i18n.t('common.availableNow'),
Expand Down

0 comments on commit 5073dfe

Please sign in to comment.