dwmkerr / angular-modal-service

Modal service for AngularJS - supports creating popups and modals via a service.
MIT License
626 stars 321 forks source link

Prevent close callbacks from running multiple times #259

Closed DougKeller closed 5 years ago

DougKeller commented 5 years ago

Addresses issue #258

Solution

  1. Move the hasAlreadyBeenClosed guard clase to the beginning of the modal's close function
  2. on $locationChangeSuccess, call the same close function so that closing the modal is always done the same way

Implications of this solution

codecov[bot] commented 5 years ago

Codecov Report

Merging #259 into master will increase coverage by 0.91%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #259      +/-   ##
==========================================
+ Coverage   85.32%   86.23%   +0.91%     
==========================================
  Files           1        1              
  Lines         109      109              
==========================================
+ Hits           93       94       +1     
+ Misses         16       15       -1
Impacted Files Coverage Δ
src/angular-modal-service.js 86.23% <100%> (+0.91%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 06a7b74...29ef82a. Read the comment docs.

dwmkerr commented 5 years ago

Excellent, thank you @DougKeller!