Add a prompt when deleting triggers
AdamHayse opened this issue ยท 4 comments
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
On the beta, Triggers are now all on on the same tab. This makes it easier to accidentally delete a trigger. It's already happened to me once.
Describe the solution you'd like
A clear and concise description of what you want to happen.
I would like a prompt added that asks if you are sure in order to prevent accidental trigger deletion.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
I started to take a quick stab at this.
Getting the confirm dialog is pretty straightforward, but it seems that although the trigger is still registering as gone, something about moving the "delete" portion into the OnAccept dialog callback is causing the change to not be reflected in the UI.
Change is staged here: keaganr@87f9228
Gif of the problem: https://imgur.com/a/pZXBqeW -- tabbing out or back in or clicking on any other button of the template appears to "refresh" the page and the trigger properly disappears.
I'll try to keep poking but I'm ultra new to addon development and WA code base as well. @InfusOnWoW - does this "refresh" problem jump out to you as familiar in any way?
Nice, that did it. Thanks.
Submitted PR for this. It's a pretty bare-bones solve for just the accidental Trigger deletion. I contemplated proposing a more generic change to cover other features that use the Delete button within the collapsible header, but I'm not sure that's as useful. In my experience it's more obvious when you're removing the text/glow/border/etc and might not be worth the additional friction.