Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,5 @@ test.py
!/.venv/

sqlbot-xpack

.claude
18 changes: 0 additions & 18 deletions frontend/src/stores/assistant.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { defineStore } from 'pinia'
import { store } from './index'
import { chatApi, ChatInfo } from '@/api/chat'
import { useCache } from '@/utils/useCache'

const { wsCache } = useCache()
const flagKey = 'sqlbit-assistant-flag'
type Resolver<T = any> = (value: T | PromiseLike<T>) => void
type Rejecter = (reason?: any) => void
interface PendingRequest<T = any> {
Expand All @@ -16,7 +12,6 @@ interface AssistantState {
id: string
token: string
assistant: boolean
flag: number
type: number
certificate: string
online: boolean
Expand All @@ -35,7 +30,6 @@ export const AssistantStore = defineStore('assistant', {
id: '',
token: '',
assistant: false,
flag: 0,
type: 0,
certificate: '',
online: false,
Expand All @@ -61,9 +55,6 @@ export const AssistantStore = defineStore('assistant', {
getAssistant(): boolean {
return this.assistant
},
getFlag(): number {
return this.flag
},
getType(): number {
return this.type
},
Expand Down Expand Up @@ -176,14 +167,6 @@ export const AssistantStore = defineStore('assistant', {
setAssistant(assistant: boolean) {
this.assistant = assistant
},
setFlag(flag: number) {
if (wsCache.get(flagKey)) {
this.flag = wsCache.get(flagKey)
} else {
this.flag = flag
wsCache.set(flagKey, flag)
}
},
setPageEmbedded(embedded?: boolean) {
this.pageEmbedded = !!embedded
},
Expand All @@ -208,7 +191,6 @@ export const AssistantStore = defineStore('assistant', {
return chat
},
clear() {
wsCache.delete(flagKey)
this.$reset()
},
},
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/views/embedded/common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ onBeforeMount(async () => {
return
}
assistantStore.setType(4)
const now = Date.now()
assistantStore.setFlag(now)
assistantStore.setId(assistantId?.toString() || '')
assistantStore.setAssistant(true)
registerReady(assistantId)
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/views/embedded/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ onBeforeMount(async () => {
const history: boolean = route.query.history !== 'false'
assistantStore.setHistory(history)

const now = Date.now()
assistantStore.setFlag(now)
assistantStore.setId(assistantId?.toString() || '')
/* const param = {
id: assistantId,
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/views/embedded/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ onBeforeMount(async () => {
if (userFlag && userFlag === '1') {
userFlag = '100001'
}
const now = Date.now()
assistantStore.setFlag(now)
assistantStore.setId(assistantId?.toString() || '')
if (assistantType === 4) {
assistantStore.setAssistant(true)
Expand Down
Loading