Skip to content

Commit

Permalink
avoid generating a new chat when storing session
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Mar 4, 2024
1 parent e7638a9 commit 1825172
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ConversationCard/index.jsx
Expand Up @@ -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',
},
}),
)
Expand Down
7 changes: 6 additions & 1 deletion src/pages/IndependentPanel/App.jsx
Expand Up @@ -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)
Expand Down

0 comments on commit 1825172

Please sign in to comment.