File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/pages/RepoPage/CoverageOnboarding/GitHubActions Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
- import { useEffect , useRef , useState } from 'react'
1
+ import { useRef , useState } from 'react'
2
2
import { useParams } from 'react-router-dom'
3
3
4
4
import { useOrgUploadToken } from 'services/orgUploadToken'
@@ -53,13 +53,11 @@ function GitHubActions() {
53
53
( isUsingGlobalToken && ! ! orgUploadToken ) ||
54
54
( ! isUsingGlobalToken && ! ! repoUploadToken )
55
55
56
- useEffect ( ( ) => {
57
- // Only set this on initial render
58
- if ( previouslyGeneratedOrgToken . current === undefined ) {
59
- previouslyGeneratedOrgToken . current = orgUploadToken
60
- }
61
- // eslint-disable-next-line react-hooks/exhaustive-deps
62
- } , [ ] )
56
+ // If orgUploadToken does not exist on initial render, set it to null and we
57
+ // do not touch it again on rerenders
58
+ if ( previouslyGeneratedOrgToken . current === undefined ) {
59
+ previouslyGeneratedOrgToken . current = orgUploadToken ?? null
60
+ }
63
61
64
62
const [ framework , setFramework ] = useState < Framework > ( 'Jest' )
65
63
You can’t perform that action at this time.
0 commit comments