Commit 240085fd authored by Paul Holden's avatar Paul Holden
Browse files

MDL-74287 forms: request changesmade string as required.

Unconditionally requesting the string was triggering exceptions
during installation, before the required external functions had
been populated.
parent 5388f91f
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -34,10 +34,6 @@ import {get_string as getString} from 'core/str';
import {dispatchEvent} from 'core/event_dispatcher';
let changesMadeString;
getString('changesmadereallygoaway', 'moodle').then(string => {
changesMadeString = string;
return string;
}).catch();
/**
* Prevent user navigate away when upload progress still running.
......@@ -192,8 +188,9 @@ export const notifyFieldValidationFailure = (field, message) => dispatchEvent(
* @returns {CustomEvent}
* @fires uploadStarted
*/
export const notifyUploadStarted = elementId => {
export const notifyUploadStarted = async elementId => {
// Add an additional check for changes made.
changesMadeString = await getString('changesmadereallygoaway', 'moodle');
window.addEventListener('beforeunload', changesMadeCheck);
return dispatchEvent(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment