mirror of https://github.com/langgenius/dify.git
sync the create/delete app in the list page
This commit is contained in:
parent
ec22b1c706
commit
1472884eb5
|
|
@ -134,15 +134,14 @@ const List = () => {
|
|||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (!workflowIds.length)
|
||||
return
|
||||
|
||||
const timer = window.setInterval(() => {
|
||||
refreshOnlineUsers()
|
||||
mutate()
|
||||
if (workflowIds.length)
|
||||
refreshOnlineUsers()
|
||||
}, 10000)
|
||||
|
||||
return () => window.clearInterval(timer)
|
||||
}, [workflowIds.join(','), refreshOnlineUsers])
|
||||
}, [workflowIds.join(','), mutate, refreshOnlineUsers])
|
||||
|
||||
const anchorRef = useRef<HTMLDivElement>(null)
|
||||
const options = [
|
||||
|
|
|
|||
|
|
@ -116,10 +116,3 @@ export class WebSocketClient {
|
|||
}
|
||||
|
||||
export const webSocketClient = new WebSocketClient()
|
||||
|
||||
export const fetchAppsOnlineUsers = async (appIds: string[]) => {
|
||||
const response = await fetch(`/api/online-users?${new URLSearchParams({
|
||||
app_ids: appIds.join(','),
|
||||
})}`)
|
||||
return response.json()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export { collaborationManager } from './core/collaboration-manager'
|
||||
export { webSocketClient, fetchAppsOnlineUsers } from './core/websocket-manager'
|
||||
export { webSocketClient } from './core/websocket-manager'
|
||||
export { CursorService } from './services/cursor-service'
|
||||
export { useCollaboration } from './hooks/use-collaboration'
|
||||
export * from './types'
|
||||
|
|
|
|||
Loading…
Reference in New Issue