mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_responsive: Add support to serve menu icon in image url
Add support to serve menu icon in image URL format rather than base64. It can take advantanges from browser caching and Nginx proxy. Signed-off-by: Fai <lamkafai1997@gmail.com>
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
|
||||
export function getWebIconData(menu) {
|
||||
const result = "/web_responsive/static/img/default_icon_app.png";
|
||||
const webIcon = menu.webIcon;
|
||||
if (webIcon && webIcon.split(",").length === 2) {
|
||||
const path = webIcon.replace(",", "/");
|
||||
return path.startsWith("/") ? path : "/" + path;
|
||||
}
|
||||
const iconData = menu.webIconData;
|
||||
if (!iconData) {
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user