From 6b2150b06694fa48842593bf12d19971419acdeb Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 25 Oct 2023 12:48:00 +0200 Subject: [PATCH] Fixed: unknown 'fhcerror' to this --- public/js/plugin/FhcAlert.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/public/js/plugin/FhcAlert.js b/public/js/plugin/FhcAlert.js index 6ff54061d..ababd0d34 100644 --- a/public/js/plugin/FhcAlert.js +++ b/public/js/plugin/FhcAlert.js @@ -263,21 +263,23 @@ export default { handleSystemMessage(message) { // Message is string if (typeof message === 'string') - return fhcerror.alertWarning(message); + { + return this.alertWarning(message); + } // Message is array of strings if (Array.isArray(message)) { // If Array has only Strings if (message.every(msg => typeof msg === 'string')) - return message.every(fhcerror.alertWarning); + return message.every(this.alertWarning); // If Array has only Objects if (message.every(msg => typeof msg === 'object') && msg !== null) { return message.every(msg => { if (msg.hasOwnProperty('data') && msg.data.hasOwnProperty('retval')) { - fhcerror.alertWarning(JSON.stringify(msg.data.retval)); + this.alertWarning(JSON.stringify(msg.data.retval)); } else { - fhcerror.alertSystemError(JSON.stringify(msg)); + this.alertSystemError(JSON.stringify(msg)); } }); } @@ -287,15 +289,15 @@ export default { if (typeof message === 'object' && message !== null){ if (message.hasOwnProperty('data') && message.data.hasOwnProperty('retval')) { // NOTE(chris): changed: alertSystemError => alertWarning - fhcerror.alertWarning(JSON.stringify(message.data.retval)); + this.alertWarning(JSON.stringify(message.data.retval)); } else { - fhcerror.alertSystemError(JSON.stringify(message)); + this.alertSystemError(JSON.stringify(message)); } return; } // Fallback - fhcerror.alertSystemError('alertSystemError throws Generic Error\r\nError Controller Path: ' + FHC_JS_DATA_STORAGE_OBJECT.called_path + '/' + FHC_JS_DATA_STORAGE_OBJECT.called_method); + this.alertSystemError('alertSystemError throws Generic Error\r\nError Controller Path: ' + FHC_JS_DATA_STORAGE_OBJECT.called_path + '/' + FHC_JS_DATA_STORAGE_OBJECT.called_method); } }; app.config.globalProperties.$fhcAlert = $fhcAlert;