From 19b89726cac6a8efe9af16cb3b574a916942348f Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 14:17:09 +0300 Subject: [PATCH] [marketplace] Fix problem with plugins images. --- store/scripts/code.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index dc3d9c25..21ae05f4 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -1184,24 +1184,17 @@ function getImageUrl(guid, bNotForStore, bSetSize, id) { // In desktop we have a local installed marketplace. It's why we use local routes only for desktop. let baseUrl; - if (installedPlugins) { + if (installedPlugins && isDesktop) { + // it doesn't work when we use icons from other resource (cors problems) + // it's why we use local icons only for desktop plugin = findPlugin(false, guid); if (plugin) { - let start; - if (isDesktop) { - baseUrl = plugin.obj.baseUrl; - } else { - baseUrl = plugin.baseUrl; - start = baseUrl.indexOf('web-apps'); - baseUrl = baseUrl.substring(0, start); - start = plugin.obj.baseUrl.indexOf('sdkjs-plugins'); - baseUrl += plugin.obj.baseUrl.substring(start); - } plugin = plugin.obj; + baseUrl = plugin.baseUrl; } } - if ( ( !plugin || ( !baseUrl.includes('https://') && !isDesktop ) ) && allPlugins) { + if ( ( !plugin || !isDesktop ) && allPlugins) { plugin = findPlugin(true, guid); if (plugin) baseUrl = plugin.baseUrl;