Clean some console.logs
This commit is contained in:
parent
8e7a371c88
commit
8112616cb2
@ -378,7 +378,6 @@ export class Client {
|
||||
}
|
||||
if (pos !== undefined) {
|
||||
// setTimeout(() => {
|
||||
console.log("Doing this pos set to", pos);
|
||||
this.editorView.dispatch({
|
||||
selection: { anchor: pos! },
|
||||
effects: EditorView.scrollIntoView(pos!, {
|
||||
@ -403,7 +402,6 @@ export class Client {
|
||||
initialCursorPos = match[0].length;
|
||||
}
|
||||
// By default scroll to the top
|
||||
console.log("Scrolling to place after frontmatter", initialCursorPos);
|
||||
this.editorView.scrollDOM.scrollTop = 0;
|
||||
this.editorView.dispatch({
|
||||
selection: { anchor: initialCursorPos },
|
||||
|
@ -46,27 +46,23 @@ export class PathPageNavigator {
|
||||
const cleanState = { ...currentState, pos: undefined, anchor: undefined };
|
||||
this.openPages.set(currentState.page || this.indexPage, cleanState);
|
||||
if (!replaceState) {
|
||||
console.log("Updating current state", currentState);
|
||||
window.history.replaceState(
|
||||
cleanState,
|
||||
"",
|
||||
`/${currentState.page}`,
|
||||
);
|
||||
console.log("Pushing new state", pageRef);
|
||||
window.history.pushState(
|
||||
pageRef,
|
||||
"",
|
||||
`/${pageRef.page}`,
|
||||
);
|
||||
} else {
|
||||
// console.log("Replacing state", pageRef);
|
||||
window.history.replaceState(
|
||||
pageRef,
|
||||
"",
|
||||
`/${pageRef.page}`,
|
||||
);
|
||||
}
|
||||
// console.log("Explicitly dispatching the popstate", pageRef);
|
||||
globalThis.dispatchEvent(
|
||||
new PopStateEvent("popstate", {
|
||||
state: pageRef,
|
||||
@ -110,16 +106,13 @@ export class PathPageNavigator {
|
||||
// Pretty low-context popstate, so let's leverage openPages
|
||||
const openPage = this.openPages.get(popState.page);
|
||||
if (openPage) {
|
||||
console.log("Pulling open page state", openPage);
|
||||
popState.selection = openPage.selection;
|
||||
popState.scrollTop = openPage.scrollTop;
|
||||
}
|
||||
}
|
||||
console.log("Got popstate state, using", popState);
|
||||
await pageLoadCallback(popState);
|
||||
} else {
|
||||
// This occurs when the page is loaded completely fresh with no browser history around it
|
||||
// console.log("Got null state so using", this.parseURI());
|
||||
const pageRef = parsePageRefFromURI();
|
||||
if (!pageRef.page) {
|
||||
pageRef.page = this.indexPage;
|
||||
|
Loading…
Reference in New Issue
Block a user