shabegom / buttons

Buttons in Obsidian
The Unlicense
478 stars 50 forks source link

Can`t remove double button by id #22

Closed BigbadHort closed 3 years ago

BigbadHort commented 3 years ago

I am trying to remove both buttons after clicking one of the two via ID

Buttons are triggered, but no deletion occurs

What's my mistake

It`s my button:

name Weekday
type prepend templates
action daily_wday
color blue
remove [wday,vih]

^button-wday

name Holiday
type prepend templates
action daily_hil
color red
remove [bud,hol]

^button-hol

Help me please

shabegom commented 3 years ago

@BigbadHort I'll take a look!

  1. Any errors in the console when you click the button?
  2. What version of obsidian and buttons are you using?
shabegom commented 3 years ago

I'm not able to reproduce the problem! I did notice the IDs you list in remove aren't the exact same as the button IDs and it should be prepend template not templates

```button name Weekday type prepend template action daily_wday color blue remove [wday,hol] ``` ^button-wday

-- make sure there is one space between the block id and next button. --

```button name Holiday type prepend template action daily_hil color red remove [wday,hol] ``` ^button-hol

shabegom commented 3 years ago

I've found a bug in the mobile app only. This has been fixed

BigbadHort commented 3 years ago

thanks for your reply 1) one space is between the block id and next button 2) Obsidian 0.11.13 3) Buttons 0.3.6

After clicking on the button, an error appears in the console buttons_error

it`t my code

name Weekday
type prepend templates
action daily_wday
color blue
remove [wday,hol]

^button-wday

name Holiday
type prepend templates
action daily_hol
color red
remove [wday,hol]

^button-hol

shabegom commented 3 years ago

Please update to the latest version. I shipped a bunch of bug fixes yesterday. Hopefully it solves this!

BigbadHort commented 3 years ago

Unfortunately, nothing has changed. My version is 0.3.7 The error is buttons_error

BigbadHort commented 3 years ago

it`s my code button

yhoebeke commented 3 years ago

It seems I am getting the same errors image

shabegom commented 3 years ago

Thanks for the reports. I will try to get to the bottom of this error!

shabegom commented 3 years ago

Would one of you be able to rung JSON.parse(localStorage.buttons) in the dev console and show what it returns? I'm thinking it isn't picking up the buttons and storing them. If they are in localStorage then that rules that out.

BigbadHort commented 3 years ago

I'm not sure I did everything right: Pasted JSON.parse(localStorage.buttons) into the console and hit enter buttons_error

shabegom commented 3 years ago

Thank you! This helps.

shabegom commented 3 years ago

I've just pushed an update that I hope fixes this issue. Please confirm after updating to 0.3.8.

BigbadHort commented 3 years ago

it`s OK with 0.3.8!!!

Thx!!!!!