Custom error notification image
{
"name": "updateErrorLogo",
"source": [
"main.6.js"
],
"lastUpdate": "2025-01-10T22:36:03.764Z",
"folderName": "updateErrorLogo",
"isEnabled": true,
"version": "1.0.0",
"skipCompilation": true,
"pluginInfraVersion": 2
}
5. Open the file `main.6.js’ and paste there the following code:
//Import your image. Value of the variable newErrorSvg is internal URL to the image
import newErrorSvg from './newErrorSvg.svg';
//Subscription at the loading directive slfQueryErrorBrand
mod.directive('slfQueryErrorBrand', [
() => {
return {
restrict: 'C',
link: async($scope, lmnt, attrs) => {
$(lmnt).hide(); //Hiding default logo
await fetch(newErrorSvg).then((response) => { //Load SVG
return response.text().then(svgContent => { //Convert response into text
lmnt[0].innerHTML = svgContent; //Replace default content with our custom one
});
}).catch((error) => {
console.error('Error loading SVG:', error);
}).finally(() => {
$(lmnt).show(); //Show logo
});
}
};
}
]);
6. Place an image with the name ‘newErrorSvg.svg’ you want to be shown instead of the default.
Now, after the plugins rebuild you will see your new image instead of the default one. Enjoy your customized error image. In the attachment, you can find the completed plugin.
0 comments