Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/components/modals/ConfigureGitModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ export default function ConfigureGitModal({ open, onClose }: ConfigureGitModalPr
user: { isPlatformAdmin },
settings: {
cluster: { domainSuffix },
otomi: { isPreInstalled },
},
} = useSession()

Expand All @@ -259,7 +258,7 @@ export default function ConfigureGitModal({ open, onClose }: ConfigureGitModalPr
const actualOpen = useMemo(() => (isControlled ? !!open : !!showGitWizard), [isControlled, open, showGitWizard])

const { data: gitSettings, isFetching: isFetchingGitSettings } = useGetGitSettingsQuery(undefined, {
skip: !isPlatformAdmin || !isPreInstalled || !actualOpen,
skip: !isPlatformAdmin || !actualOpen,
})

const defaultGitUrl = gitSettings?.repoUrl || ''
Expand Down Expand Up @@ -306,10 +305,6 @@ export default function ConfigureGitModal({ open, onClose }: ConfigureGitModalPr
if (showGitWizard === undefined) setShowGitWizard(true)
}, [showGitWizard, setShowGitWizard])

useEffect(() => {
if (!isPreInstalled && !isControlled) setShowGitWizard(false)
}, [isPreInstalled, isControlled, setShowGitWizard])

useEffect(() => {
if (!actualOpen) {
resetModalState()
Expand Down Expand Up @@ -406,7 +401,7 @@ export default function ConfigureGitModal({ open, onClose }: ConfigureGitModalPr
}
}

if (!isPlatformAdmin || !isPreInstalled) return null
if (!isPlatformAdmin) return null
if (!isControlled && !showGitWizard) return null

return (
Expand Down