mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 12:24:47 +00:00
execute error page hooks
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
scroll_history,
|
||||
scroll_state,
|
||||
select_target,
|
||||
handle_error,
|
||||
set_target,
|
||||
uid,
|
||||
set_uid,
|
||||
@@ -34,10 +35,12 @@ export default function start(opts: {
|
||||
|
||||
history.replaceState({ id: uid }, '', href);
|
||||
|
||||
if (!initial_data.error) {
|
||||
const target = select_target(new URL(location.href));
|
||||
if (target) return navigate(target, uid, false, hash);
|
||||
}
|
||||
const url = new URL(location.href)
|
||||
|
||||
if (initial_data.error) return handle_error(url);
|
||||
|
||||
const target = select_target(url);
|
||||
if (target) return navigate(target, uid, false, hash);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -127,4 +130,4 @@ function handle_popstate(event: PopStateEvent) {
|
||||
set_cid(uid);
|
||||
history.replaceState({ id: cid }, '', location.href);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user