Skip to content

Commit

Permalink
fixed double auth request on rerender
Browse files Browse the repository at this point in the history
  • Loading branch information
PepperLola authored and HunterBarclay committed Jul 27, 2024
1 parent 8c423cf commit 842c8c7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ const worker = new Lazy<Worker>(() => new WPILibWSWorker())
function Synthesis() {
const urlParams = new URLSearchParams(document.location.search)
const has_code = urlParams.has("code")
if (has_code) {
const code = urlParams.get("code")
if (code) {
APS.convertAuthToken(code).then(() => {
document.location.search = ""
})
useEffect(() => {
if (has_code) {
const code = urlParams.get("code")
if (code) {
APS.convertAuthToken(code).then(() => {
document.location.search = ""
})
}
}
}
}, [])
const { openModal, closeModal, getActiveModalElement } = useModalManager(initialModals)
const { openPanel, closePanel, closeAllPanels, getActivePanelElements } = usePanelManager(initialPanels)
const { showTooltip } = useTooltipManager()
Expand Down

0 comments on commit 842c8c7

Please sign in to comment.