Skip to content

Commit

Permalink
Add conditional for course error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-mediakitchen committed Nov 28, 2023
1 parent f07a603 commit 4245ceb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/scorm/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ class ScormWrapper {
if (!Adapt.course) return;

const config = Adapt.course.get('_spoor');
const messages = Object.assign({}, ScormError.defaultMessages, config && config._messages);
const defaultMessages = ScormError.defaultMessages;
const configMessages = config?.['_messages'] || {};
const messages = Object.assign({}, defaultMessages, configMessages);
const message = Handlebars.compile(messages[error.name])(error.data);

switch (error.name) {
Expand Down

0 comments on commit 4245ceb

Please sign in to comment.