From 3caaee5581567c75be791f122364b30aa7629af7 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 27 Nov 2023 19:12:53 +0700 Subject: [PATCH] simplify --- html5/js/Client.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/html5/js/Client.js b/html5/js/Client.js index 3ef513cc..eb61ab72 100644 --- a/html5/js/Client.js +++ b/html5/js/Client.js @@ -2908,15 +2908,11 @@ class XpraClient { xdg_image(icon_data, icon_type) { const img = new Image(); if (typeof icon_data !== "undefined") { + let image_type = "image/"+icon_type; if (icon_type == "svg") { - img.src = `data:image/svg+xml;base64,${Utilities.ArrayBufferToBase64( - icon_data - )}`; - } else if (icon_type == "png" || icon_type == "jpeg") { - img.src = `data:image/${icon_type};base64,${Utilities.ArrayBufferToBase64( - icon_data - )}`; + image_type = "image/svg+xml"; } + img.src = `data:{image_type};base64,${Utilities.ArrayBufferToBase64(icon_data)}`; } img.className = "menu-content-left"; img.height = 24;