mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 10:45:54 +00:00
chore: release version v1.12.6
This commit is contained in:
@@ -18,7 +18,7 @@ export const useTagMenu = (
|
|||||||
ref.current = { onSystemTag, systems, systemId };
|
ref.current = { onSystemTag, systems, systemId };
|
||||||
|
|
||||||
return useCallback(() => {
|
return useCallback(() => {
|
||||||
const { onSystemTag, systemId , systems} = ref.current;
|
const { onSystemTag, systemId, systems } = ref.current;
|
||||||
const system = systemId ? getSystemById(systems, systemId) : undefined;
|
const system = systemId ? getSystemById(systems, systemId) : undefined;
|
||||||
|
|
||||||
const isSelectedLetters = AVAILABLE_LETTERS.includes(system?.tag ?? '');
|
const isSelectedLetters = AVAILABLE_LETTERS.includes(system?.tag ?? '');
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
import { Node, useReactFlow } from 'reactflow';
|
import { Node, useReactFlow } from 'reactflow';
|
||||||
import { useCallback } from 'react';
|
import { useCallback, useRef } from 'react';
|
||||||
import { CommandAddSystems } from '@/hooks/Mapper/types/mapHandlers.ts';
|
import { CommandAddSystems } from '@/hooks/Mapper/types/mapHandlers.ts';
|
||||||
import { convertSystem2Node } from '../../helpers';
|
import { convertSystem2Node } from '../../helpers';
|
||||||
|
|
||||||
export const useMapAddSystems = () => {
|
export const useMapAddSystems = () => {
|
||||||
const rf = useReactFlow();
|
const rf = useReactFlow();
|
||||||
|
|
||||||
return useCallback(
|
const ref = useRef({ rf });
|
||||||
(systems: CommandAddSystems) => {
|
ref.current = { rf };
|
||||||
const nodes = rf.getNodes();
|
|
||||||
const prepared: Node[] = systems.filter(x => !nodes.some(y => x.id === y.id)).map(convertSystem2Node);
|
return useCallback((systems: CommandAddSystems) => {
|
||||||
rf.addNodes(prepared);
|
const { rf } = ref.current;
|
||||||
},
|
const nodes = rf.getNodes();
|
||||||
[rf],
|
const prepared: Node[] = systems.filter(x => !nodes.some(y => x.id === y.id)).map(convertSystem2Node);
|
||||||
);
|
rf.addNodes(prepared);
|
||||||
|
}, []);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user