-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move logic for fetching activities to SDK
- Loading branch information
1 parent
b3e00ed
commit acd81b7
Showing
8 changed files
with
30 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
import { useEffect } from "react" | ||
import { useInterval } from "@chakra-ui/react" | ||
import { ONE_MINUTE_IN_SECONDS, ONE_SEC_IN_MILLISECONDS } from "#/constants" | ||
import { useFetchBTCBalance } from "./useFetchBTCBalance" | ||
import { useFetchMinDepositAmount } from "./useFetchMinDepositAmount" | ||
import { useFetchDeposits } from "./useFetchDeposits" | ||
import { useWalletContext } from "../useWalletContext" | ||
|
||
const INTERVAL_TIME = ONE_SEC_IN_MILLISECONDS * ONE_MINUTE_IN_SECONDS * 30 | ||
|
||
export function useInitDataFromSdk() { | ||
const { btcAccount } = useWalletContext() | ||
const fetchDeposits = useFetchDeposits() | ||
|
||
useEffect(() => { | ||
if (btcAccount) { | ||
fetchDeposits() | ||
} | ||
}, [btcAccount, fetchDeposits]) | ||
|
||
useFetchBTCBalance() | ||
useFetchMinDepositAmount() | ||
useInterval(fetchDeposits, INTERVAL_TIME) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters