Skip to content

Commit 3c73af7

Browse files
authored
Update packages/svelte/src/internal/client/runtime.js
1 parent a7b9f57 commit 3c73af7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,10 @@ export function get(signal) {
674674
update_derived(derived);
675675
} else if ((derived.f & HAS_EFFECTS) !== 0 && derived.effects === null) {
676676
// Recreate effects they have been destroyed without turning the derived dirty.
677+
// Clear flag first in case the derived would now no longer create an effect
678+
// because it's executing a different if-branch for example. Will be readded
679+
// via create_effect if there turns out to be one.
680+
derived.f ^= HAS_EFFECTS;
677681
update_derived(derived);
678682
}
679683
}

0 commit comments

Comments
 (0)