boris-jenicek/ngx-awesome-popup

I think the YES event on confirmation popup emits twice

Closed this issue · 2 comments

Firstly thanks for a great library. Works beautifully. Easy to understand too!

For the quick start confirmation popup, I copy pasted the code almost identically...but for me the YES event fires twice?

So I had to put a take(1) to prevent it:

    this.confirmBox.openConfirmBox$().pipe(take(1)).subscribe(resp => {
      if (resp.Success) {
        // save to api and send to customer
        this.updateOnApi();
      }
    });

Maybe it's because in your code you immediately unsubscribe?

I think maybe the reason you immediately unsubscribe is so you can have multiple popups on the same page without them sending events to one another, and only the one that was opened. I only just thought of that!

Thank you @rmcsharry for your contribution, I am glad that you found it useful, soon I'll look in that issue.

@rmcsharry thank you again, all that could improve this lib it's very welcome.
The new release is launched with this bugfix,
please look for more info - here: https://github.com/costlydeveloper/ngx-awesome-popup/releases/tag/1.0.4
or join release discussion - here: #6