sawhney17 / logseq-citation-manager

73 stars 12 forks source link

Fixes #57; clarify behavior in plugin settings. #58

Open jmuchovej opened 1 year ago

jmuchovej commented 1 year ago

URLs must be prefixed with a protocol to pass validation (and for axios to understand the URL). Upon triggering a "Reindex Citations DB" this fetchDatabase (formerly getPaperPile) will attempt to download BibTeX hosted at a given URL.

Adds validator as a dependency (to validate URLs). Also clarifies new behavior in plugin settings. I used Markdown when writing the description, because these lines of the SettingSchemaDesc seem to point to description supporting Markdown. However, there are a few Logseq plugins that confirm that this isn't necessarily true (perhaps in 0.8.17?), so if you think we should remove it, feel free! 🙂

jmuchovej commented 1 year ago

I've been using this version for the last few days, on launch, Logseq often claims the plugin is "slowing Logseq start-up". I'm guessing it's probably because it downloads the BibTeX from a URL.

Do you know if there's a way to delay that until Logseq has loaded? (Put another way – do you know if Logseq has some kind of "event listener"-like system? E.g., if Logseq emits a "logseq-loaded" message, then whenever the path is a URL, we can begin the refresh process, so we don't slow down loading Logseq.)

sawhney17 commented 1 year ago

I believe that you can use the logseq.on() function for this purpose as a listener for the logseq loaded message.

jmuchovej commented 1 year ago

Hmm... I don't see any mention of logseq.on() on @logseq/libs. Do you mean logseq.ready()?

I also think I sorted out the "slowing Logseq start-up", I forgot to run pnpm dev on the local version I've been testing! 😅 So far, the main oddity has been the occasional hiccup with loading the DB from the URL, but that triggers a redownload anyways, so it shows up on the next usage.