Skip to content

Commit 1e92922

Browse files
committed
fix: ensure unowned deriveds correctly get re-linked to the graph
1 parent 9c5e708 commit 1e92922

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,16 @@ export function check_dirtiness(reaction) {
219219
// If we are working with an unowned signal as part of an effect (due to !skip_reaction)
220220
// and the version hasn't changed, we still need to check that this reaction
221221
// is linked to the dependency source – otherwise future updates will not be caught.
222-
if (
223-
is_unowned &&
224-
active_effect !== null &&
225-
!skip_reaction &&
226-
!dependency?.reactions?.includes(reaction)
227-
) {
228-
(dependency.reactions ??= []).push(reaction);
222+
if (is_unowned && active_effect !== null && !skip_reaction) {
223+
if (!dependency?.reactions?.includes(reaction)) {
224+
(dependency.reactions ??= []).push(reaction);
225+
}
226+
229227
if (version_mismatch) {
230228
unowned_dirty = true;
231229
}
232230
} else if (version_mismatch) {
233-
return true
231+
return true;
234232
}
235233
}
236234

0 commit comments

Comments
 (0)