From b9a1a156595195f2874ab18ccf0cabfec50c4970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=BCpkes?= Date: Tue, 11 Nov 2025 23:30:58 +0100 Subject: [PATCH 1/3] Show meaningful error message --- src/gas/script-api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gas/script-api.js b/src/gas/script-api.js index ef0e5d8..7a0ddff 100644 --- a/src/gas/script-api.js +++ b/src/gas/script-api.js @@ -74,7 +74,7 @@ class ScriptApi { location.reload(); }) .catch((err) => { - showLog(err.message, LEVEL_ERROR); + showLog(err.responseJSON.error.message, LEVEL_ERROR); }); } @@ -132,7 +132,7 @@ class ScriptApi { location.reload(); }) .catch((err) => { - showLog(err.message, LEVEL_ERROR); + showLog(err.responseJSON.error.message, LEVEL_ERROR); }); } From f633492667bd1945cec5955a58e3ba20facc0ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=BCpkes?= Date: Wed, 12 Nov 2025 00:05:39 +0100 Subject: [PATCH 2/3] Prevent duplicate page content --- src/gas-hub.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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', () => { From e3133ac8669d0dbe67333e647b3764a89090c3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=BCpkes?= Date: Wed, 12 Nov 2025 00:25:15 +0100 Subject: [PATCH 3/3] Rename variable for clarity --- src/gas/script-api.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gas/script-api.js b/src/gas/script-api.js index 7a0ddff..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.responseJSON.error.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.responseJSON.error.message, LEVEL_ERROR); + .catch((jqXHR) => { + showLog(jqXHR.responseJSON.error.message, LEVEL_ERROR); }); }