Skip to content

Commit b90232d

Browse files
committed
fix
1 parent 72185af commit b90232d

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

packages/svelte/src/internal/client/dom/blocks/svelte-head.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @import { TemplateNode } from '#client' */
22
import { hydrate_node, hydrating, set_hydrate_node, set_hydrating } from '../hydration.js';
33
import { create_text, get_first_child, get_next_sibling } from '../operations.js';
4-
import { block, branch } from '../../reactivity/effects.js';
4+
import { block } from '../../reactivity/effects.js';
55
import { COMMENT_NODE, HEAD_EFFECT } from '#client/constants';
66

77
/**
@@ -49,7 +49,7 @@ export function head(hash, render_fn) {
4949
}
5050

5151
try {
52-
block(() => branch(() => render_fn(anchor)), HEAD_EFFECT);
52+
block(() => render_fn(anchor), HEAD_EFFECT);
5353
} finally {
5454
if (was_hydrating) {
5555
set_hydrating(true);

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,25 @@ import {
1414
MAYBE_DIRTY,
1515
DERIVED,
1616
BOUNDARY_EFFECT,
17-
EAGER_EFFECT
17+
EAGER_EFFECT,
18+
HEAD_EFFECT
1819
} from '#client/constants';
1920
import { async_mode_flag } from '../../flags/index.js';
2021
import { deferred, define_property } from '../../shared/utils.js';
2122
import {
2223
active_effect,
2324
get,
24-
increment_write_version,
2525
is_dirty,
2626
is_updating_effect,
2727
set_is_updating_effect,
2828
set_signal_status,
29-
tick,
3029
update_effect
3130
} from '../runtime.js';
3231
import * as e from '../errors.js';
3332
import { flush_tasks, queue_micro_task } from '../dom/task.js';
3433
import { DEV } from 'esm-env';
3534
import { invoke_error_boundary } from '../error-handling.js';
36-
import {
37-
flush_eager_effects,
38-
eager_effects,
39-
old_values,
40-
set_eager_effects,
41-
source,
42-
update
43-
} from './sources.js';
35+
import { flush_eager_effects, old_values, set_eager_effects, source, update } from './sources.js';
4436
import { eager_effect, unlink_effect } from './effects.js';
4537

4638
/**
@@ -800,7 +792,12 @@ export function schedule_effect(signal) {
800792

801793
// if the effect is being scheduled because a parent (each/await/etc) block
802794
// updated an internal source, bail out or we'll cause a second flush
803-
if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) {
795+
if (
796+
is_flushing &&
797+
effect === active_effect &&
798+
(flags & BLOCK_EFFECT) !== 0 &&
799+
(flags & HEAD_EFFECT) === 0
800+
) {
804801
return;
805802
}
806803

0 commit comments

Comments
 (0)