Eagerly redirect to workspace

This commit is contained in:
Caleb Owens 2024-08-05 15:47:54 +02:00
parent 9593904fa7
commit e0bdfc425a

View File

@ -31,19 +31,19 @@
$effect(() => { $effect(() => {
if (branchListing) { if (branchListing) {
const branchesWithGivenName: Branch[] | undefined = branchesByGivenName[branchListing.name]; if (branchListing.virtualBranch?.inWorkspace) {
if (branchesWithGivenName === undefined) {
if (branchListing.virtualBranch) {
goto(`/${project.id}/board`);
} else {
error('Failed to find branch');
goto(`/${project.id}/board`); goto(`/${project.id}/board`);
} }
} else {
const branchesWithGivenName: Branch[] | undefined = branchesByGivenName[branchListing.name];
if (branchesWithGivenName) {
localBranch = branchesWithGivenName.find((branch) => !branch.isRemote); localBranch = branchesWithGivenName.find((branch) => !branch.isRemote);
remoteBranches = branchesWithGivenName.filter((branch) => branch.isRemote); remoteBranches = branchesWithGivenName.filter((branch) => branch.isRemote);
} else {
error('Failed to find branch');
goto(`/${project.id}/board`);
} }
} }
}); });