Skip to content

Commit 469c44e

Browse files
committed
deduplicate
1 parent 6964a07 commit 469c44e

File tree

1 file changed

+5
-10
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+5
-10
lines changed

packages/svelte/src/internal/client/dom/blocks/if.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ export function if_block(anchor, get_condition, consequent_fn, alternate_fn, els
9090
consequent_fn(anchor);
9191
consequent_dom = block.d;
9292

93-
if (mismatch) {
94-
// Set fragment so that Svelte continues to operate in hydration mode
95-
set_current_hydration_fragment([]);
96-
}
97-
9893
return () => {
9994
// TODO make this unnecessary by linking the dom to the effect,
10095
// and removing automatically on teardown
@@ -124,11 +119,6 @@ export function if_block(anchor, get_condition, consequent_fn, alternate_fn, els
124119
alternate_fn(anchor);
125120
alternate_dom = block.d;
126121

127-
if (mismatch) {
128-
// Set fragment so that Svelte continues to operate in hydration mode
129-
set_current_hydration_fragment([]);
130-
}
131-
132122
return () => {
133123
// TODO make this unnecessary by linking the dom to the effect,
134124
// and removing automatically on teardown
@@ -150,6 +140,11 @@ export function if_block(anchor, get_condition, consequent_fn, alternate_fn, els
150140
});
151141
}
152142
}
143+
144+
if (mismatch) {
145+
// Set fragment so that Svelte continues to operate in hydration mode
146+
set_current_hydration_fragment([]);
147+
}
153148
}, block);
154149

155150
if (elseif) {

0 commit comments

Comments
 (0)