Skip to content

Commit 1825172

Browse files
committed
avoid generating a new chat when storing session
1 parent e7638a9 commit 1825172

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/ConversationCard/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ function ConversationCard(props) {
454454
Browser.runtime.sendMessage({
455455
type: 'OPEN_URL',
456456
data: {
457-
url: Browser.runtime.getURL('IndependentPanel.html'),
457+
url: Browser.runtime.getURL('IndependentPanel.html') + '?from=store',
458458
},
459459
}),
460460
)

src/pages/IndependentPanel/App.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ function App() {
4949
useEffect(() => {
5050
// eslint-disable-next-line
5151
;(async () => {
52+
const urlFrom = new URLSearchParams(window.location.search).get('from')
5253
const sessions = await getSessions()
53-
if (sessions[0].conversationRecords && sessions[0].conversationRecords.length > 0) {
54+
if (
55+
urlFrom !== 'store' &&
56+
sessions[0].conversationRecords &&
57+
sessions[0].conversationRecords.length > 0
58+
) {
5459
await createNewChat()
5560
} else {
5661
setSessions(sessions)

0 commit comments

Comments
 (0)