-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #938 from tonwhales/release/v2.3.3
Release/v2.3.3
- Loading branch information
Showing
24 changed files
with
479 additions
and
258 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 +1 @@ | ||
196 | ||
197 |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { memo } from "react"; | ||
import { usePendingWatcher } from "../engine/hooks"; | ||
|
||
export const PendingTxsWatcher = memo(() => { | ||
// clear pending txs on account change | ||
usePendingWatcher(); | ||
return <></>; | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useCallback, useEffect, useRef } from "react"; | ||
import { usePendingTransactions } from ".."; | ||
|
||
export function usePendingActions(address: string, isTestnet: boolean) { | ||
const [pending, setPending] = usePendingTransactions(address, isTestnet); | ||
const setPendingRef = useRef(setPending); | ||
|
||
useEffect(() => { | ||
setPendingRef.current = setPending; | ||
}, [setPending]); | ||
|
||
const removePending = useCallback((ids: string[]) => { | ||
if (ids.length === 0) { | ||
return; | ||
} | ||
setPendingRef.current((prev) => { | ||
return prev.filter((tx) => !ids.includes(tx.id)); | ||
}); | ||
}, []); | ||
|
||
const markAsTimedOut = useCallback((id: string) => { | ||
setPendingRef.current((prev) => { | ||
return prev.map((tx) => { | ||
if (tx.id === id) { | ||
return { ...tx, status: 'timed-out' }; | ||
} | ||
return tx; | ||
}); | ||
}); | ||
}, []); | ||
|
||
return { state: pending, removePending, markAsTimedOut }; | ||
} |
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
Oops, something went wrong.