File size: 437 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { useMemo } from 'react'
import { useStore } from '../store'

export const useWorkflowMode = () => {
  const historyWorkflowData = useStore(s => s.historyWorkflowData)
  const isRestoring = useStore(s => s.isRestoring)
  return useMemo(() => {
    return {
      normal: !historyWorkflowData && !isRestoring,
      restoring: isRestoring,
      viewHistory: !!historyWorkflowData,
    }
  }, [historyWorkflowData, isRestoring])
}