prevent multiple runs of useStarterPackEntry
This commit is contained in:
@@ -11,9 +11,12 @@ export function useStarterPackEntry() {
|
|||||||
const [ready, setReady] = React.useState(false)
|
const [ready, setReady] = React.useState(false)
|
||||||
const setCurrentStarterPack = useSetCurrentStarterPack()
|
const setCurrentStarterPack = useSetCurrentStarterPack()
|
||||||
const usedStarterPacks = useUsedStarterPacks()
|
const usedStarterPacks = useUsedStarterPacks()
|
||||||
|
const hasRan = React.useRef(false)
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (ready) return
|
if (ready || hasRan.current) return
|
||||||
|
|
||||||
|
hasRan.current = true
|
||||||
;(async () => {
|
;(async () => {
|
||||||
let uri: string | null | undefined
|
let uri: string | null | undefined
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user