MDL-86385 reportbuilder: fix schedule promise thennable chain.

This commit is contained in:
Paul Holden
2025-10-20 16:13:08 +01:00
parent 56326e2357
commit ef42934848
3 changed files with 4 additions and 7 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -5
View File
@@ -115,14 +115,11 @@ export const init = reportId => {
const labelContainer = scheduleToggle.parentElement.querySelector(`label[for="${scheduleToggle.id}"] > span`);
labelContainer.innerHTML = toggleLabel;
// Now fetch the toast string based on new state.
const toastKey = scheduleStateToggle ? 'scheduleenabled' : 'scheduledisabled';
return getString(toastKey, 'core_reportbuilder');
})
.then(toastMessage => {
addToast(toastMessage);
return pendingPromise.resolve();
})
.then(addToast)
.then(() => pendingPromise.resolve())
.catch(Notification.exception);
}