Skip to content

Commit cbd13ee

Browse files
committed
Finishing touch to ReactiveQuery refactor
Missed some opportunities to use `query.response` rather than `query.result.data`.
1 parent 8cfa0a5 commit cbd13ee

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

apps/desktop/src/routes/[projectId]/+layout.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
5858
// Project data
5959
const projectsQuery = $derived(projectsService.projects());
60-
const projects = $derived(projectsQuery.result.data);
60+
const projects = $derived(projectsQuery.response);
6161
const currentProject = $derived(projects?.find((p) => p.id === projectId));
6262
6363
// =============================================================================
@@ -69,12 +69,14 @@
6969
const gitService = inject(GIT_SERVICE);
7070
7171
const repoInfoQuery = $derived(baseBranchService.repo(projectId));
72-
const repoInfo = $derived(repoInfoQuery.result.data);
72+
const pushRepoQuery = $derived(baseBranchService.pushRepo(projectId));
73+
74+
const repoInfo = $derived(repoInfoQuery.response);
75+
const forkInfo = $derived(pushRepoQuery.response);
76+
7377
const baseBranchQuery = $derived(baseBranchService.baseBranch(projectId));
74-
const baseBranch = $derived(baseBranchQuery.result.data);
78+
const baseBranch = $derived(baseBranchQuery.response);
7579
const baseBranchName = $derived(baseBranch?.shortName);
76-
const pushRepoQuery = $derived(baseBranchService.pushRepo(projectId));
77-
const forkInfo = $derived(pushRepoQuery.result.data);
7880
7981
// =============================================================================
8082
// WORKSPACE & MODE MANAGEMENT
@@ -86,7 +88,7 @@
8688
8789
const mode = $derived(modeService.mode({ projectId }));
8890
const headQuery = $derived(modeService.head({ projectId }));
89-
const head = $derived(headQuery.result.data);
91+
const head = $derived(headQuery.response);
9092
9193
// Invalidate stacks when switching branches outside workspace
9294
$effect(() => {
@@ -223,7 +225,7 @@
223225
224226
// Refresh when branch data changes
225227
$effect(() => {
226-
if (baseBranch || headQuery.result.data) debouncedRemoteBranchRefresh();
228+
if (baseBranch || headQuery.response) debouncedRemoteBranchRefresh();
227229
});
228230
229231
// Auto-fetch setup

0 commit comments

Comments
 (0)