mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-23 12:50:47 +08:00
avoid generating a new chat when storing session
This commit is contained in:
@@ -454,7 +454,7 @@ function ConversationCard(props) {
|
||||
Browser.runtime.sendMessage({
|
||||
type: 'OPEN_URL',
|
||||
data: {
|
||||
url: Browser.runtime.getURL('IndependentPanel.html'),
|
||||
url: Browser.runtime.getURL('IndependentPanel.html') + '?from=store',
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -49,8 +49,13 @@ function App() {
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line
|
||||
;(async () => {
|
||||
const urlFrom = new URLSearchParams(window.location.search).get('from')
|
||||
const sessions = await getSessions()
|
||||
if (sessions[0].conversationRecords && sessions[0].conversationRecords.length > 0) {
|
||||
if (
|
||||
urlFrom !== 'store' &&
|
||||
sessions[0].conversationRecords &&
|
||||
sessions[0].conversationRecords.length > 0
|
||||
) {
|
||||
await createNewChat()
|
||||
} else {
|
||||
setSessions(sessions)
|
||||
|
||||
Reference in New Issue
Block a user