decord/source/modules/virtual_currency/hooks/useFetchVirtualCurrencyBalance.tsx

48 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9290
// Function ID: 9291
2026-07-20 16:05:17 +00:00
// Name: useFetchVirtualCurrencyBalance
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 9291, 589, 9292, 2]
2026-07-20 16:05:17 +00:00
// Exports: useFetchVirtualCurrencyBalance
2026-08-24 06:08:38 +00:00
// Module 9290 (useFetchVirtualCurrencyBalance)
import set from "set" /* 2 */;
import noop from "noop" /* 19 */;
import closure_3 from "redeemError" /* 9291 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const useEffect = noop.useEffect;
const result = set.fileFinishedImporting("modules/virtual_currency/hooks/useFetchVirtualCurrencyBalance.tsx");
2026-07-20 16:05:17 +00:00
export const useFetchVirtualCurrencyBalance = function useFetchVirtualCurrencyBalance(disableFetch) {
2026-07-23 10:11:24 +00:00
const _require = disableFetch;
2026-08-24 06:08:38 +00:00
const items = [closure_3];
const isFetching = _require(balance[2]).useStateFromStoresObject(items, () => ({ balance: closure_3.balance, isFetching: closure_3.isFetchingBalance, error: closure_3.fetchBalanceError }));
2026-07-23 10:11:24 +00:00
balance = isFetching.balance;
2026-08-24 06:08:38 +00:00
error = isFetching.error;
2026-07-20 16:05:17 +00:00
const items1 = [balance, error, ];
disableFetch = undefined;
2026-07-29 08:29:29 +00:00
if (disableFetch != null) {
2026-07-20 16:05:17 +00:00
disableFetch = disableFetch.disableFetch;
}
items1[2] = disableFetch;
2026-07-23 10:11:24 +00:00
error(() => {
2026-08-24 06:08:38 +00:00
disableFetch = undefined;
2026-07-29 08:29:29 +00:00
if (disableFetch != null) {
disableFetch = disableFetch.disableFetch;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!disableFetch) {
disableFetch = null !== balance;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!disableFetch) {
disableFetch = null !== error;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!disableFetch) {
2026-08-24 06:08:38 +00:00
disableFetch = closure_1_3.isFetchingBalance;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!disableFetch) {
2026-07-23 10:11:24 +00:00
const virtualCurrencyBalance = disableFetch(balance[3]).fetchVirtualCurrencyBalance();
const obj = disableFetch(balance[3]);
2026-07-20 16:05:17 +00:00
}
}, items1);
return { balance, isFetching: isFetching.isFetching, error };
};