Skip to content

Commit

Permalink
Merge pull request #529 from RabotaRu/v3.11.2
Browse files Browse the repository at this point in the history
Исправлена ошибка работы плагина в режиме Enterprise
  • Loading branch information
rpiontik authored Apr 24, 2024
2 parents 42f945e + 9ce254b commit d086fc6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/frontend/manifest/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const queryDriver = {
if (env.isBackendMode() && e?.request?.response) {
const content = typeof e?.request?.response === 'object' ? e?.request?.response : JSON.parse(e?.request?.response);
message = content.message;
// eslint-disable-next-line no-console
console.error(message);
throw new Error(message);
} else throw e;
Expand Down
14 changes: 10 additions & 4 deletions src/ide/idea/papi.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,24 @@ const fwCefQuery = '%$dochub-api-interface-func%';
let cefQuery = params.get('$dochub-api-interface-func');

// Если в параметрах интерфейсная функция не передана...
if (!cefQuery && window[fwCefQuery]) {
if (cefQuery) {
// eslint-disable-next-line no-console
console.info('Нашел интерфейсную функцию в параметрах!');
} else if (!cefQuery && window[fwCefQuery]) {
cefQuery = fwCefQuery;
// eslint-disable-next-line no-console
console.info('Нашел интерфейсную функцию в коде!');
} else if (window.localStorage && cefQuery) {
} else if (!cefQuery && window.localStorage && localStorage.getItem('cefQuery')) {
// eslint-disable-next-line no-console
console.info('Нашел интерфейсную функцию в localStorage!');
cefQuery = localStorage.getItem('cefQuery');
} else {
console.info('Нашел интерфейсную функцию в параметрах!');
// eslint-disable-next-line no-console
console.info('Интерфейсную функцию не нашел.');
}

// eslint-disable-next-line no-console
console.info('Plugin API function: ', cefQuery);
cefQuery && console.info('Plugin API function: ', cefQuery);

if (cefQuery && window[cefQuery]) {
PAPI.cefQuery = window[cefQuery];
Expand Down

0 comments on commit d086fc6

Please sign in to comment.