-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
removeDepositData
method to our TBTC
class
Adds `removeDepositData` method to our `TBTC` class. This method just removes deposit data form our `this._deposit` property. We will use it just after the reveal and in `useRemoveDepositData` hook.
- Loading branch information
1 parent
1ce6350
commit f3512f9
Showing
2 changed files
with
14 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { useCallback } from "react" | ||
import { useThreshold } from "../../contexts/ThresholdContext" | ||
import { useTbtcState } from "../useTbtcState" | ||
import { useTBTCDepositDataFromLocalStorage } from "./useTBTCDepositDataFromLocalStorage" | ||
|
||
export const useRemoveDepositData = () => { | ||
const { resetDepositData } = useTbtcState() | ||
const { removeDepositDataFromLocalStorage } = | ||
useTBTCDepositDataFromLocalStorage() | ||
const threshold = useThreshold() | ||
|
||
return useCallback(() => { | ||
removeDepositDataFromLocalStorage() | ||
resetDepositData() | ||
}, [resetDepositData, removeDepositDataFromLocalStorage]) | ||
threshold.tbtc.removeDepositData() | ||
}, [resetDepositData, removeDepositDataFromLocalStorage, threshold]) | ||
} |
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