avoid generating a new chat when storing session

This commit is contained in:
josc146
2024-03-04 22:56:19 +08:00
parent e7638a9003
commit 1825172b47
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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',
},
}),
)
+6 -1
View File
@@ -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)