mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 06:09:08 +03:00
fix branch query
This commit is contained in:
1 parent
59b132105d
commit
48ce60553f
3 files changed
+10
-6
No files matched your search
@@ -17,7 +17,7 @@ export function useBranchCommands() {
|
||||
|
||||
let { data: branches } = useBranchesQuery(
|
||||
{
|
||||
projectRef: selectedProject?.parentRef,
|
||||
projectRef: selectedProject?.parent_project_ref || selectedProject?.ref,
|
||||
},
|
||||
{ enabled: isBranchingEnabled }
|
||||
)
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ const SidePanelGitHubRepoLinker = ({ projectRef }: SidePanelGitHubRepoLinkerProp
|
||||
)
|
||||
|
||||
const { data: existingBranches } = useBranchesQuery(
|
||||
{ projectRef: selectedProject?.ref },
|
||||
{ projectRef: selectedProject?.parent_project_ref || selectedProject?.ref },
|
||||
{ enabled: !!selectedProject?.ref }
|
||||
)
|
||||
|
||||
|
||||
@@ -80,10 +80,14 @@ export const BranchDropdown = () => {
|
||||
const projectDetails = useSelectedProject()
|
||||
const snap = useAppStateSnapshot()
|
||||
|
||||
const isBranch = projectDetails?.parent_project_ref !== undefined
|
||||
const projectRef =
|
||||
projectDetails !== undefined ? (isBranch ? projectDetails.parent_project_ref : ref) : undefined
|
||||
const { data: branches, isLoading, isError, isSuccess } = useBranchesQuery({ projectRef })
|
||||
const projectRef = projectDetails?.parent_project_ref || ref
|
||||
|
||||
const {
|
||||
data: branches,
|
||||
isLoading,
|
||||
isError,
|
||||
isSuccess,
|
||||
} = useBranchesQuery({ projectRef }, { enabled: Boolean(projectDetails) })
|
||||
|
||||
const isBranchingEnabled = projectDetails?.is_branch_enabled === true
|
||||
const selectedBranch = branches?.find((branch) => branch.project_ref === ref)
|
||||
|
||||
Reference in new issue
Block a user