Skip to content

Commit 9ed8732

Browse files
adamluikudo-sync-bot
authored andcommitted
Replaced invalid optional chaining w/ traditional if check ↞ [auto-sync from adamlui/chatgpt-infinity/opera]
1 parent e558d4c commit 9ed8732

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

chatgpt-infinity/chrome/extension/content.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
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+
const navicon = document.getElementById('infToggleFavicon')
67+
if (navicon) navicon.src = `${ // update navicon color in case scheme changed
6768
config.assetHostURL }media/images/icons/infinity-symbol/${
6869
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
6970
}

chatgpt-infinity/edge/extension/content.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
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+
const navicon = document.getElementById('infToggleFavicon')
67+
if (navicon) navicon.src = `${ // update navicon color in case scheme changed
6768
config.assetHostURL }media/images/icons/infinity-symbol/${
6869
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
6970
}

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

Lines changed: 3 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.3
202+
// @version 2024.6.25.4
203203
// @license MIT
204204
// @match *://chatgpt.com/*
205205
// @match *://chat.openai.com/*
@@ -552,7 +552,8 @@
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+
const navicon = document.getElementById('infToggleFavicon')
556+
if (navicon) navicon.src = `${ // update navicon color in case scheme changed
556557
config.assetHostURL }media/images/icons/infinity-symbol/${
557558
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
558559
}

chatgpt-infinity/opera/extension/content.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
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+
const navicon = document.getElementById('infToggleFavicon')
67+
if (navicon) navicon.src = `${ // update navicon color in case scheme changed
6768
config.assetHostURL }media/images/icons/infinity-symbol/${
6869
chatgpt.isDarkMode() ? 'white' : 'black' }/icon32.png`
6970
}

0 commit comments

Comments
 (0)