chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.54k stars 137 forks source link

[BUG] Capture Choice → Error when capturing to a Specific Note vs. Active Note #431

Closed FelipeRearden closed 1 year ago

FelipeRearden commented 1 year ago

Hello @chhoumann !!!!!

Describe the bug

I am facing a different behavior for two Capture Choice that has the same output BUT the difference between these two Captures is that one of then is:

🅰️ Capture to the Active Note 🅱️ Capture to a Specific File

✅ Working perfect on 🅰️

❌ When I run 🅱️ I got this ERROR MESSAGE: E6528A21-F172-4667-A3B8-22A1DF93BBC8

This is the Capture code → I am using a inline script

const aTexts =   [ "Quotes", "Aphorisms", "info"];
const callouts = [ "### Quotes", "### Aphorisms", "info"];
const txt =   [ "Lorem", "Ipsum"];
const out = [ "### Lorem", "### Ipsum"];

let choice = await this.quickAddApi.suggester(aTexts, callouts);

if (choice === "info" ) {
let item = await this.quickAddApi.suggester(txt, out);
return item;
} else {
return choice;
}

To Reproduce Steps to reproduce the behavior:

  1. Create Capture Choice 🅰️
  2. Create Capture Choice 🅱️
  3. Run 🅰️
  4. Run 🅱️
  5. See error after running 🅱️

Expected behavior Choice 🅱️ should run exactly like Choice 🅰️

Screenshots 📸 🅰️ FA285D42-FB46-4AC7-A84F-B68303D5BC6D

📸 🅱️ A3DA9BB1-9D74-486A-9603-549ECFC93A91

Smartphone (please complete the following information):

Additional context Thank you very much for reading this 🙏

I wish you a fantastic day ☀️

chhoumann commented 1 year ago

Hey @FelipeRearden! Thank you for reporting this.

I've just attempted to recreate the issue, but cannot seem to. Any chance this was fixed 'accidentally' in v0.18? :)

Or is there anywhere a variable is declared twice? I.e. let item appears twice? Or any attempt at assigning a const variable after it has been declared initially? Just want to rule it out - even though it doesn't appear in the code you've provided.

Wishing you a great day as well!

FelipeRearden commented 1 year ago

Hey @FelipeRearden! Thank you for reporting this.

Hello @chhoumann !!!! Thnank you very much for the reply :)

I've just attempted to recreate the issue, but cannot seem to. Any chance this was fixed 'accidentally' in v0.18? :)

I think the Obsidian gods are in our side today. It's working prefect on version 0.18.1 🙏🙏🙏

Thanks for the reminder :)

Wishing you a great day as well!

Me too. I hope you have a fantastic monday :)