ember-remodal icon indicating copy to clipboard operation
ember-remodal copied to clipboard

modal.close() promise never resolves

Open sukima opened this issue 6 years ago • 0 comments

This is cause by the remodal bug: https://github.com/vodkabears/Remodal/issues/291

Not that this will get fixed but it is here for documentation reasons.

open() {
  let openPromise = this.get('remodal').open(MODAL_NAME);
  this.set('openPromise', openPromise);
  return openPromise;
},
close() {
  return this.get('openPromise').then(() => {
    let modal = this.get(`remodal.${MODAL_NAME}.modal`);
    let modalState = Ember.tryInvoke(modal, 'getState');
    if (modalState !== 'opened') { return; }
    return this.get('remodal').close(MODAL_NAME);
  });
}

sukima avatar Apr 20 '18 21:04 sukima