Skip to content

Commit e558d4c

Browse files
adamluikudo-sync-bot
authored andcommitted
Added optional chaininng to navicon selector in insertToggle()
...to declutter console of ugly undefined errs when Toggle Visibility is off ↞ [auto-sync from `adamlui/chatgpt-infinity/greasemonkey`]
1 parent d562c5b commit e558d4c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

chatgpt-infinity/chrome/extension/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if (isGPT4oUI) navToggleDiv.style.flexGrow = 'unset' // overcome OpenAI .grow
6464
if (!firstLink) parentToInsertInto.children[0].style.marginBottom = '5px'
6565
navToggleDiv.style.paddingLeft = '8px'
66-
document.getElementById('infToggleFavicon').src = `${ // update navicon color in case scheme changed
66+
document.getElementById('infToggleFavicon')?.src = `${ // update navicon color in case scheme changed
6767
config.assetHostURL }media/images/icons/infinity-symbol/${
6868
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
6969
}

chatgpt-infinity/edge/extension/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if (isGPT4oUI) navToggleDiv.style.flexGrow = 'unset' // overcome OpenAI .grow
6464
if (!firstLink) parentToInsertInto.children[0].style.marginBottom = '5px'
6565
navToggleDiv.style.paddingLeft = '8px'
66-
document.getElementById('infToggleFavicon').src = `${ // update navicon color in case scheme changed
66+
document.getElementById('infToggleFavicon')?.src = `${ // update navicon color in case scheme changed
6767
config.assetHostURL }media/images/icons/infinity-symbol/${
6868
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
6969
}

chatgpt-infinity/greasemonkey/chatgpt-infinity.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
// @description:zh-TW 從無所不知的 ChatGPT 生成無窮無盡的答案 (用任何語言!)
200200
// @author Adam Lui
201201
// @namespace https://github.com/adamlui
202-
// @version 2024.6.25.2
202+
// @version 2024.6.25.3
203203
// @license MIT
204204
// @match *://chatgpt.com/*
205205
// @match *://chat.openai.com/*
@@ -552,7 +552,7 @@
552552
if (isGPT4oUI) navToggleDiv.style.flexGrow = 'unset' // overcome OpenAI .grow
553553
if (!firstLink) parentToInsertInto.children[0].style.marginBottom = '5px'
554554
navToggleDiv.style.paddingLeft = '8px'
555-
document.getElementById('infToggleFavicon').src = `${ // update navicon color in case scheme changed
555+
document.getElementById('infToggleFavicon')?.src = `${ // update navicon color in case scheme changed
556556
config.assetHostURL }media/images/icons/infinity-symbol/${
557557
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
558558
}

chatgpt-infinity/opera/extension/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if (isGPT4oUI) navToggleDiv.style.flexGrow = 'unset' // overcome OpenAI .grow
6464
if (!firstLink) parentToInsertInto.children[0].style.marginBottom = '5px'
6565
navToggleDiv.style.paddingLeft = '8px'
66-
document.getElementById('infToggleFavicon').src = `${ // update navicon color in case scheme changed
66+
document.getElementById('infToggleFavicon')?.src = `${ // update navicon color in case scheme changed
6767
config.assetHostURL }media/images/icons/infinity-symbol/${
6868
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
6969
}

0 commit comments

Comments
 (0)