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

46 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 9253
// Function ID: 9254
2026-07-20 16:05:17 +00:00
// Name: useFetchVirtualCurrencyBalance
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 9254, 589, 9255, 2]
2026-07-20 16:05:17 +00:00
// Exports: useFetchVirtualCurrencyBalance
2026-08-15 05:55:55 +00:00
// Module 9253 (useFetchVirtualCurrencyBalance)
2026-07-29 08:29:29 +00:00
import { useEffect } from "noop";
import redeemError from "redeemError";
2026-07-23 10:11:24 +00:00
const result = require("initialize").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-07-29 08:29:29 +00:00
const items = [redeemError];
const isFetching = _require(balance[2]).useStateFromStoresObject(items, () => ({ balance: redeemError.balance, isFetching: redeemError.isFetchingBalance, error: redeemError.fetchBalanceError }));
2026-07-23 10:11:24 +00:00
balance = isFetching.balance;
2026-07-20 16:05:17 +00:00
const error = isFetching.error;
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-07-29 08:29:29 +00:00
let disableFetch;
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) {
disableFetch = outer1_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 };
};