diff --git a/src/gas-hub.js b/src/gas-hub.js index 066ec94..801a6d5 100644 --- a/src/gas-hub.js +++ b/src/gas-hub.js @@ -136,8 +136,12 @@ function initPageContent() { $.get(chrome.runtime.getURL('content/modal.html')) ]) .then((content) => { - $('.INSTk').last().before(content[0]); - $('body').children().last().after(content[1]); + if ($('div#config-button').length == 0) { + $('.INSTk').last().before(content[0]); + } + if ($('div#diff-modal').length == 0) { + $('body').children().last().after(content[1]); + } }) .then(() => { $(document).on('click', '.scm-alert-dismiss', () => { diff --git a/src/gas/script-api.js b/src/gas/script-api.js index ef0e5d8..4227263 100644 --- a/src/gas/script-api.js +++ b/src/gas/script-api.js @@ -73,8 +73,8 @@ class ScriptApi { showLog('Successfully pulled from scm'); location.reload(); }) - .catch((err) => { - showLog(err.message, LEVEL_ERROR); + .catch((jqXHR) => { + showLog(jqXHR.responseJSON.error.message, LEVEL_ERROR); }); } @@ -131,8 +131,8 @@ class ScriptApi { showLog('Successfully pulled from scm'); location.reload(); }) - .catch((err) => { - showLog(err.message, LEVEL_ERROR); + .catch((jqXHR) => { + showLog(jqXHR.responseJSON.error.message, LEVEL_ERROR); }); }