Update setFilterEdge references in code

This commit is contained in:
anovazzi1 2024-01-15 16:20:15 -03:00 committed by Lucas Oliveira
commit cbea369c2c
7 changed files with 12 additions and 10 deletions

View file

@ -71,7 +71,7 @@ export default function ParameterComponent({
const groupedEdge = useRef(null);
const setFilterEdge = useTypesStore((state) => state.setFilterEdge);
const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
let disabled =
edges.some(

View file

@ -50,7 +50,7 @@ export default function Page({
);
const types = useTypesStore((state) => state.types);
const templates = useTypesStore((state) => state.templates);
const setFilterEdge = useTypesStore((state) => state.setFilterEdge);
const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
const reactFlowWrapper = useRef<HTMLDivElement>(null);
const reactFlowInstance = useFlowStore((state) => state.reactFlowInstance);

View file

@ -29,8 +29,8 @@ import SidebarDraggableComponent from "./sideBarDraggableComponent";
export default function ExtraSidebar(): JSX.Element {
const data = useTypesStore((state) => state.data);
const templates = useTypesStore((state) => state.templates);
const getFilterEdge = useTypesStore((state) => state.getFilterEdge);
const setFilterEdge = useTypesStore((state) => state.setFilterEdge);
const getFilterEdge = useFlowStore((state) => state.getFilterEdge);
const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow);
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const hasStore = useStoreStore((state) => state.hasStore);

View file

@ -257,8 +257,13 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
flowState: undefined,
sseData: {},
isBuilt: false,
getFilterEdge: [],
});
},
setFilterEdge: (newState) => {
set({ getFilterEdge: newState });
},
getFilterEdge: []
}));
export default useFlowStore;

View file

@ -9,7 +9,6 @@ export const useTypesStore = create<TypesStoreType>((set, get) => ({
types: {},
templates: {},
data: {},
getFilterEdge: [],
getTypes: () => {
return new Promise<void>(async (resolve, reject) => {
getAll()
@ -44,7 +43,5 @@ export const useTypesStore = create<TypesStoreType>((set, get) => ({
let newChange = typeof change === "function" ? change(get().data) : change;
set({ data: newChange });
},
setFilterEdge: (newState) => {
set({ getFilterEdge: newState });
},
}));

View file

@ -50,4 +50,6 @@ export type FlowStoreType = {
isBuilt: boolean;
setIsBuilt: (isBuilt: boolean) => void;
cleanFlow: () => void;
setFilterEdge: (newState) => void;
getFilterEdge: any[];
};

View file

@ -8,6 +8,4 @@ export type TypesStoreType = {
data: APIDataType;
setData: (newState: {}) => void;
getTypes: () => Promise<void>;
setFilterEdge: (newState) => void;
getFilterEdge: any[];
};