🚸 (editor) Enable groups clipboard accross tabs
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { createWithEqualityFn } from 'zustand/traditional'
|
||||
import { Coordinates, CoordinatesMap } from '../types'
|
||||
import { Edge, Group, GroupV6 } from '@typebot.io/schemas'
|
||||
import { persist } from 'zustand/middleware'
|
||||
|
||||
type Store = {
|
||||
focusedGroups: string[]
|
||||
@ -19,7 +20,9 @@ type Store = {
|
||||
setIsDraggingGraph: (isDragging: boolean) => void
|
||||
}
|
||||
|
||||
export const useGroupsStore = createWithEqualityFn<Store>((set, get) => ({
|
||||
export const useGroupsStore = createWithEqualityFn<Store>()(
|
||||
persist(
|
||||
(set, get) => ({
|
||||
focusedGroups: [],
|
||||
groupsCoordinates: undefined,
|
||||
groupsInClipboard: undefined,
|
||||
@ -84,4 +87,10 @@ export const useGroupsStore = createWithEqualityFn<Store>((set, get) => ({
|
||||
},
|
||||
}),
|
||||
setIsDraggingGraph: (isDragging) => set({ isDraggingGraph: isDragging }),
|
||||
}))
|
||||
}),
|
||||
{
|
||||
name: 'store',
|
||||
partialize: (state) => ({ groupsInClipboard: state.groupsInClipboard }),
|
||||
}
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user