pull/17038/head
Rich Harris 4 weeks ago
parent 60370e67cd
commit 55acec628c

@ -293,19 +293,32 @@ export function run(thunks) {
boundary.update_pending_count(1); boundary.update_pending_count(1);
batch.increment(blocking); batch.increment(blocking);
let was_hydrating = hydrating;
const promises = thunks.map((fn) => { const promises = thunks.map((fn) => {
promise = promise promise = promise
.then(() => { .then(() => {
// TODO abort if component was destroyed // TODO abort if component was destroyed?
try { try {
restore(); restore();
return fn(); return fn();
} finally { } finally {
// TODO do we need it here as well as below?
unset_context(); unset_context();
if (was_hydrating) {
set_hydrating(false);
}
} }
}) })
.then(noop); .then(() => {
unset_context();
if (was_hydrating) {
set_hydrating(false);
}
});
return promise; return promise;
}); });

Loading…
Cancel
Save