[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧩 logseq.App.onRouteChanged #23

Open
utterances-bot opened this issue Jul 13, 2024 · 2 comments
Open

🧩 logseq.App.onRouteChanged #23

utterances-bot opened this issue Jul 13, 2024 · 2 comments

Comments

@utterances-bot
Copy link

https://plugins-doc.logseq.com/logseq/App/onRouteChanged

Copy link
YU000jp commented Jul 13, 2024

Currently, there is a bug. The callback is not returned every time. Therefore, it must be used in conjunction with onPageHeadActionsSlotted() to guarantee that it works.

const processing = false

logseq.App.onRouteChanged(async ()=> {
if(processing) return
setTimeout(() => { processing = false }, 1000)
processing = true
routeChanged()
})
logseq.App.onPageHeadActionsSlotted(async () => {
if(processing) return
setTimeout(() => { processing = false }, 1000)
processing = true
routeChanged()
})

const routeChanged = () => {
// Here

}

@benjypng
Copy link

🤔 Seems to work for me unless I am missing something. Is there a reproducible example where the callback is not triggered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants