Fix some nasty bug
parent
b858917c98
commit
7f647758c2
|
@ -17,7 +17,7 @@ export class CompleterHook implements Hook<CompleterHookT> {
|
|||
continue;
|
||||
}
|
||||
for (const [functionName, functionDef] of Object.entries(
|
||||
plug.manifest.functions
|
||||
plug.manifest.functions
|
||||
)) {
|
||||
if (functionDef.isCompleter) {
|
||||
completerPromises.push(plug.invoke(functionName, []));
|
||||
|
@ -29,7 +29,7 @@ export class CompleterHook implements Hook<CompleterHookT> {
|
|||
if (result) {
|
||||
if (actualResult) {
|
||||
console.error(
|
||||
"Got completion results from multiple sources, cannot deal with that"
|
||||
"Got completion results from multiple sources, cannot deal with that"
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -27,22 +27,19 @@ export class PathPageNavigator {
|
|||
subscribe(
|
||||
pageLoadCallback: (pageName: string, pos: number) => Promise<void>
|
||||
): void {
|
||||
const cb = (event?: PopStateEvent) => {
|
||||
const gotoPage = this.getCurrentPage();
|
||||
if (!gotoPage) {
|
||||
return;
|
||||
const cb = (event?: PopStateEvent) => {
|
||||
const gotoPage = this.getCurrentPage();
|
||||
if (!gotoPage) {
|
||||
return;
|
||||
}
|
||||
safeRun(async () => {
|
||||
await pageLoadCallback(this.getCurrentPage(), event && event.state.pos);
|
||||
if (this.navigationResolve) {
|
||||
this.navigationResolve();
|
||||
}
|
||||
safeRun(async () => {
|
||||
await pageLoadCallback(
|
||||
this.getCurrentPage(),
|
||||
event && event.state.pos
|
||||
);
|
||||
if (this.navigationResolve) {
|
||||
this.navigationResolve();
|
||||
}
|
||||
});
|
||||
};
|
||||
window.addEventListener("popstate", cb);
|
||||
});
|
||||
};
|
||||
window.addEventListener("popstate", cb);
|
||||
cb();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue