Skip to content

Commit 453891a

Browse files
Merge pull request #9017 from gitbutlerapp/Add-missing-deriveds
Add missing deriveds
2 parents a61dd7f + bbcdcae commit 453891a

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

apps/desktop/src/components/v3/BranchList.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@
8585
let headerMenuContext = $state<BranchHeaderContextItem>();
8686
8787
const stackingReorderDropzoneManagerFactory = getContext(StackingReorderDropzoneManagerFactory);
88-
const stackingReorderDropzoneManager = stackingReorderDropzoneManagerFactory.build(
89-
stackId,
90-
branches.map((s) => ({ name: s.name, commitIds: s.commits.map((p) => p.id) }))
88+
const stackingReorderDropzoneManager = $derived(
89+
stackingReorderDropzoneManagerFactory.build(
90+
stackId,
91+
branches.map((s) => ({ name: s.name, commitIds: s.commits.map((p) => p.id) }))
92+
)
9193
);
9294
</script>
9395

apps/desktop/src/components/v3/StackView.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@
6262
6363
let dropzoneActivated = $state(false);
6464
65-
const stackState = uiState.stack(stack.id);
65+
const stackState = $derived(uiState.stack(stack.id));
6666
const selection = $derived(stackState.selection);
67-
const assignedSelection = idSelection.getById({
68-
type: 'worktree',
69-
stackId: stack.id
70-
});
71-
const lastAddedAssigned = assignedSelection.lastAdded;
67+
const assignedSelection = $derived(
68+
idSelection.getById({
69+
type: 'worktree',
70+
stackId: stack.id
71+
})
72+
);
73+
const lastAddedAssigned = $derived(assignedSelection.lastAdded);
7274
const assignedKey = $derived(
7375
$lastAddedAssigned?.key ? readKey($lastAddedAssigned.key) : undefined
7476
);
@@ -87,7 +89,7 @@
8789
const selectedKey = $derived(
8890
$selectedLastAdded?.key ? readKey($selectedLastAdded.key) : undefined
8991
);
90-
const changes = uncommittedService.changesByStackId(stack.id || null);
92+
const changes = $derived(uncommittedService.changesByStackId(stack.id || null));
9193
9294
let laneEl = $state<HTMLDivElement>();
9395
let detailsEl = $state<HTMLDivElement>();

0 commit comments

Comments
 (0)