When no modals are displayed and dismissAllModals is called, resolve the promise successfully. This regression was introduced in #5991