Avoid error if egw.image is not a function

happens on doc site
This commit is contained in:
nathan 2024-06-12 15:49:52 -06:00
parent 7ea76b2e12
commit 5b0ab2d4c5

View File

@ -15,7 +15,7 @@ import {egw} from "../../jsapi/egw_global";
registerIconLibrary('default', {
resolver: name =>
{
return typeof egw !== "undefined" ? (egw.image(name) ?? `${egw.webserverUrl || ""}/node_modules/@shoelace-style/shoelace/dist/assets/icons/${name}.svg`) : ''
return typeof egw !== "undefined" && typeof egw.image == "function" ? (egw.image(name) ?? `${egw.webserverUrl || ""}/node_modules/@shoelace-style/shoelace/dist/assets/icons/${name}.svg`) : ''
},
});