Skip to content

Commit

Permalink
fix: don't create feature export before launch darkly import (#3510)
Browse files Browse the repository at this point in the history
Co-authored-by: Novak Zaballa <[email protected]>
  • Loading branch information
matthewelwell and novakzaballa authored Mar 11, 2024
1 parent 42ab1d0 commit afadf5a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions frontend/web/components/import-export/ImportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const ImportPage: FC<ImportPageType> = ({
const {
data: status,
isSuccess: statusLoaded,
isUninitialized,
refetch,
} = useGetLaunchDarklyProjectImportQuery(
{
Expand Down Expand Up @@ -76,9 +77,11 @@ const ImportPage: FC<ImportPageType> = ({
useEffect(() => {
if (isSuccess && data?.id) {
setImportId(data.id)
refetch()
if (!isUninitialized) {
refetch()
}
}
}, [isSuccess, data, refetch])
}, [isSuccess, data, refetch, isUninitialized])

const getProjectList = (LDKey: string) => {
setIsLoading(true)
Expand All @@ -97,10 +100,6 @@ const ImportPage: FC<ImportPageType> = ({
key: string,
projectId: string,
) => {
createFeatureExport(getStore(), {
environment_id: environmentId,
tag_ids: [],
})
createLaunchDarklyProjectImport({
body: { project_key: key, token: LDKey },
project_id: projectId,
Expand Down

0 comments on commit afadf5a

Please sign in to comment.