Skip to content

Commit 1a9f42a

Browse files
CopilotByron
andcommitted
Add documentation comments for stackId null handling fix
Co-authored-by: Byron <[email protected]>
1 parent 1bfea14 commit 1a9f42a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

apps/desktop/src/lib/stacks/stackService.svelte.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ export class StackService {
606606
return this.api.endpoints.branchChanges.useQuery(
607607
{
608608
projectId: args.projectId,
609+
// Handle case where URL parameters convert null to "null" string
609610
stackId: args.stackId === 'null' ? null : args.stackId,
610611
branch: args.branch
611612
},
@@ -622,6 +623,7 @@ export class StackService {
622623
return this.api.endpoints.branchChanges.useQuery(
623624
{
624625
projectId: args.projectId,
626+
// Handle case where URL parameters convert null to "null" string
625627
stackId: args.stackId === 'null' ? null : args.stackId,
626628
branch: args.branch
627629
},
@@ -638,6 +640,7 @@ export class StackService {
638640
const result = await this.api.endpoints.branchChanges.fetch(
639641
{
640642
projectId: args.projectId,
643+
// Handle case where URL parameters convert null to "null" string
641644
stackId: args.stackId === 'null' ? null : args.stackId,
642645
branch: args.branch
643646
},

apps/desktop/src/routes/[projectId]/workspace/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
const stackId = $derived(projectState.stackId.current);
1818
1919
// Check for stackId in URL query parameters
20+
// Note: URLSearchParams.get() returns strings, so "null" becomes the string "null"
21+
// We need to convert it back to actual null for proper API handling
2022
const urlStackId = $derived((() => {
2123
const param = page.url.searchParams.get('stackId');
2224
// Convert string "null" back to actual null

0 commit comments

Comments
 (0)