Skip to content

Commit 3495bfa

Browse files
committed
Added check config.preferredAPI set before string comparison in modals.api() ↞ [auto-sync from https://github.com/adamlui/userscripts/tree/master/chatgpt/amazongpt]
1 parent a0f7528 commit 3495bfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.8.24
6+
// @version 2025.8.24.1
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -1425,7 +1425,7 @@
14251425
btnsDiv.querySelectorAll('button').forEach((btn, idx) => {
14261426
if (idx == 0) btn.style.display = 'none' // hide Dismiss button
14271427
else btn.classList.toggle('primary-modal-btn', // emphasize preferred API
1428-
config.preferredAPI.toLowerCase() == btn.textContent.toLowerCase()
1428+
config.preferredAPI && config.preferredAPI.toLowerCase() == btn.textContent.toLowerCase()
14291429
|| btn.textContent == app.msgs.menuLabel_random && !config.preferredAPI)
14301430
})
14311431

0 commit comments

Comments
 (0)