mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-27 19:30:28 +08:00
improve NotificationForChatGPTWeb (#710)
This commit is contained in:
@@ -12,10 +12,12 @@ export function Hyperlink({ href, children }) {
|
||||
<span
|
||||
{...linkProperties}
|
||||
onClick={() => {
|
||||
const url = new URL(href)
|
||||
url.searchParams.set('chatgptbox_notification', 'true')
|
||||
Browser.runtime.sendMessage({
|
||||
type: 'NEW_URL',
|
||||
data: {
|
||||
url: href,
|
||||
url: url.toString(),
|
||||
pinned: false,
|
||||
saveAsChatgptConfig: true,
|
||||
},
|
||||
|
||||
@@ -71,7 +71,7 @@ const NotificationForChatGPTWeb = () => {
|
||||
style={{
|
||||
width: '440px',
|
||||
}}
|
||||
position="top-right"
|
||||
position="top-center"
|
||||
autoClose={7000}
|
||||
newestOnTop={false}
|
||||
closeOnClick={false}
|
||||
|
||||
@@ -324,7 +324,11 @@ async function prepareForForegroundRequests() {
|
||||
|
||||
if (!chatgptWebModelKeys.some((model) => userConfig.activeApiModes.includes(model))) return
|
||||
|
||||
if (chatgptWebModelKeys.includes(userConfig.modelName)) {
|
||||
const url = new URL(window.location.href)
|
||||
if (
|
||||
url.searchParams.has('chatgptbox_notification') &&
|
||||
chatgptWebModelKeys.includes(userConfig.modelName)
|
||||
) {
|
||||
const div = document.createElement('div')
|
||||
document.body.append(div)
|
||||
render(<NotificationForChatGPTWeb container={div} />, div)
|
||||
|
||||
Reference in New Issue
Block a user