@@ -6,7 +6,7 @@ import { Key, memo, SetStateAction, useCallback, useEffect, useRef, useState } f
66import Browser from 'webextension-polyfill'
77import { defaultConfig , getUserConfig } from '../configs/userConfig'
88import { useClampWindowSize } from '../hooks/useClampWindowSize'
9- import { ConversationRecord , initSession , isSafari , Session } from '../utils'
9+ import { ConversationRecord , initSession , Session } from '../utils'
1010import ChatInputBox from './ChatInputBox'
1111import ChatItem from './ChatItem'
1212
@@ -150,22 +150,13 @@ function ChatCard(props: ChatCardProps) {
150150 }
151151 if ( msg . error ) {
152152 switch ( msg . error ) {
153- case 'UNAUTHORIZED' :
153+ case 'UNAUTHORIZED' || 'CLOUDFLARE' :
154154 UpdateAnswer (
155- `UNAUTHORIZED\nPlease login at https://chat.openai.com first${
156- isSafari ( ) ? 'Then open https://chat.openai.com/api/auth/session' : ''
157- } \nAnd refresh this page or type you question again.` +
158- `\n\nConsider creating an api key at https://platform.openai.com/account/api-keys` ,
159- false ,
160- 'error' ,
161- )
162- break
163- case 'CLOUDFLARE' :
164- UpdateAnswer (
165- `OpenAI Security Check Required\nPlease open ${
166- isSafari ( ) ? 'https://chat.openai.com/api/auth/session' : 'https://chat.openai.com'
167- } \nAnd refresh this page or type you question again.` +
168- `\n\nConsider creating an api key at https://platform.openai.com/account/api-keys` ,
155+ `**ACCESS DENIED**: Kindly log in at [https://chat.openai.com](https://chat.openai.com) first.
156+ Afterward, refresh this webpage or re-enter your inquiry.
157+ You may also want to create an API key at
158+ [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys)
159+ for enhanced functionality.` ,
169160 false ,
170161 'error' ,
171162 )
0 commit comments