diff options
author | Eric Bailey <git@esb.lol> | 2024-09-11 21:56:20 -0500 |
---|---|---|
committer | Eric Bailey <git@esb.lol> | 2024-09-11 21:56:20 -0500 |
commit | c99e43d6c625ed7d0bb4f1d25026512460445bef (patch) | |
tree | c56a43755503dc020eba9fd0d66e68d3cf4e3102 /src/components/dialogs/nuxs/TenMillion/index.tsx | |
parent | 45c8d89d9212bf7160317185f8418bdebbf3b617 (diff) | |
download | voidsky-c99e43d6c625ed7d0bb4f1d25026512460445bef.tar.zst |
Protect against other exit methods, protect against multiple fetches
Diffstat (limited to 'src/components/dialogs/nuxs/TenMillion/index.tsx')
-rw-r--r-- | src/components/dialogs/nuxs/TenMillion/index.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/components/dialogs/nuxs/TenMillion/index.tsx b/src/components/dialogs/nuxs/TenMillion/index.tsx index f5c8435de..c77755145 100644 --- a/src/components/dialogs/nuxs/TenMillion/index.tsx +++ b/src/components/dialogs/nuxs/TenMillion/index.tsx @@ -87,6 +87,7 @@ export function TenMillion() { const agent = useAgent() const nuxDialogs = useNuxDialogContext() const [userNumber, setUserNumber] = React.useState<number>(0) + const fetching = React.useRef(false) React.useEffect(() => { async function fetchUserNumber() { @@ -119,9 +120,12 @@ export function TenMillion() { } } - networkRetry(3, fetchUserNumber).catch(() => { - nuxDialogs.dismissActiveNux() - }) + if (!fetching.current) { + fetching.current = true + networkRetry(3, fetchUserNumber).catch(() => { + nuxDialogs.dismissActiveNux() + }) + } }, [ agent.sessionManager.pdsUrl, agent.session?.accessJwt, |