This commit is contained in:
AlexeyMatveev686
2023-04-17 14:00:00 +03:00
parent cdd2644c4b
commit e7ff1b4a52

View File

@ -361,7 +361,7 @@ window.addEventListener('message', function(message) {
};
}, false);
function fetchAllPlugins(bFirstRender, bConnectionRestored) {
function fetchAllPlugins(bFirstRender, bshowMarketplace) {
// function for fetching all plugins from config
clearInterval(interval);
interval = null;
@ -370,7 +370,7 @@ function fetchAllPlugins(bFirstRender, bConnectionRestored) {
function(response) {
allPlugins = JSON.parse(response);
if (installedPlugins)
getAllPluginsData(bFirstRender, bConnectionRestored);
getAllPluginsData(bFirstRender, bshowMarketplace);
},
function(err) {
createError( new Error( getTranslated( 'Problem with loading markeplace config.' ) ) );
@ -483,7 +483,7 @@ function toogleLoader(show, text) {
}
};
function getAllPluginsData(bFirstRender, bConnectionRestored) {
function getAllPluginsData(bFirstRender, bshowMarketplace) {
// get config file for each item in config.json
isPluginLoading = true;
let count = 0;
@ -507,7 +507,7 @@ function getAllPluginsData(bFirstRender, bConnectionRestored) {
isPluginLoading = false;
if (bFirstRender)
showMarketplace();
else if (bConnectionRestored)
else if (bshowMarketplace)
toogleView(elements.btnMarketplace, elements.btnMyPlugins, messages.linkPR, true, true);
}
makeRequest(pluginUrl + 'translations/langs.json').then(
@ -540,7 +540,7 @@ function getAllPluginsData(bFirstRender, bConnectionRestored) {
isPluginLoading = false;
if (bFirstRender)
showMarketplace();
else if (bConnectionRestored)
else if (bshowMarketplace)
toogleView(elements.btnMarketplace, elements.btnMyPlugins, messages.linkPR, true, true);
}
}
@ -1488,7 +1488,8 @@ function checkInternet() {
if (this.readyState == 4) {
if (this.status >= 200 && this.status < 300) {
isOnline = true;
fetchAllPlugins(interval === null, elements.btnMarketplace.classList.contains('btn_toolbar_active'));
let bshowMarketplace = ( elements.btnMarketplace && elements.btnMarketplace.classList.contains('btn_toolbar_active') ) ? true : false;
fetchAllPlugins(interval === null, bshowMarketplace);
}
}
};