mirror of
https://github.com/langgenius/dify.git
synced 2026-04-15 18:06:36 +08:00
fix: toast import
This commit is contained in:
parent
6708bd3085
commit
4695fb66ae
@ -6,7 +6,7 @@ import type {
|
||||
OnlineUser,
|
||||
} from '../types/collaboration'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||
import { collaborationManager } from '../core/collaboration-manager'
|
||||
import { CursorService } from '../services/cursor-service'
|
||||
@ -105,10 +105,7 @@ export function useCollaboration(appId: string, reactFlowStore?: ReactFlowStore)
|
||||
const prevIsConnected = useRef(false)
|
||||
useEffect(() => {
|
||||
if (prevIsConnected.current && !state.isConnected) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: 'Network connection lost. Please check your network.',
|
||||
})
|
||||
toast.error('Network connection lost. Please check your network.')
|
||||
}
|
||||
prevIsConnected.current = state.isConnected || false
|
||||
}, [state.isConnected])
|
||||
|
||||
@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
|
||||
import { useReactFlow } from 'reactflow'
|
||||
import { useStore as useAppStore } from '@/app/components/app/store'
|
||||
import { useFeaturesStore } from '@/app/components/base/features/hooks'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||
import { collaborationManager } from '../collaboration/core/collaboration-manager'
|
||||
import { useWorkflowStore } from '../store'
|
||||
@ -85,15 +85,11 @@ export const useLeaderRestoreListener = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = collaborationManager.onRestoreRequest((data: RestoreRequestData) => {
|
||||
Toast.notify({
|
||||
type: 'info',
|
||||
message: t('versionHistory.action.restoreInProgress', {
|
||||
ns: 'workflow',
|
||||
userName: data.initiatorName,
|
||||
versionName: data.versionName || data.versionId,
|
||||
}),
|
||||
duration: 3000,
|
||||
})
|
||||
toast.info(t('versionHistory.action.restoreInProgress', {
|
||||
ns: 'workflow',
|
||||
userName: data.initiatorName,
|
||||
versionName: data.versionName || data.versionId,
|
||||
}), { duration: 3000 })
|
||||
performRestore(data)
|
||||
})
|
||||
|
||||
@ -102,15 +98,11 @@ export const useLeaderRestoreListener = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = collaborationManager.onRestoreIntent((data: RestoreIntentData) => {
|
||||
Toast.notify({
|
||||
type: 'info',
|
||||
message: t('versionHistory.action.restoreInProgress', {
|
||||
ns: 'workflow',
|
||||
userName: data.initiatorName,
|
||||
versionName: data.versionName || data.versionId,
|
||||
}),
|
||||
duration: 3000,
|
||||
})
|
||||
toast.info(t('versionHistory.action.restoreInProgress', {
|
||||
ns: 'workflow',
|
||||
userName: data.initiatorName,
|
||||
versionName: data.versionName || data.versionId,
|
||||
}), { duration: 3000 })
|
||||
})
|
||||
|
||||
return unsubscribe
|
||||
|
||||
Loading…
Reference in New Issue
Block a user