mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: fix linting errors
This commit is contained in:
parent
dbf1fb002f
commit
08e5f6853b
@ -22,7 +22,6 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
Tabs,
|
Tabs,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
debounce,
|
|
||||||
tabsClasses,
|
tabsClasses,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import {
|
import {
|
||||||
@ -47,17 +46,17 @@ import { useDelete, useDeleteFromCache } from "@/hooks/crud/useDelete";
|
|||||||
import { useFind } from "@/hooks/crud/useFind";
|
import { useFind } from "@/hooks/crud/useFind";
|
||||||
import { useGetFromCache } from "@/hooks/crud/useGet";
|
import { useGetFromCache } from "@/hooks/crud/useGet";
|
||||||
import { useUpdate, useUpdateCache } from "@/hooks/crud/useUpdate";
|
import { useUpdate, useUpdateCache } from "@/hooks/crud/useUpdate";
|
||||||
|
import useDebouncedUpdate from "@/hooks/useDebouncedUpdate";
|
||||||
import { getDisplayDialogs, useDialog } from "@/hooks/useDialog";
|
import { getDisplayDialogs, useDialog } from "@/hooks/useDialog";
|
||||||
import { useSearch } from "@/hooks/useSearch";
|
import { useSearch } from "@/hooks/useSearch";
|
||||||
import { EntityType, Format } from "@/services/types";
|
import { EntityType, Format } from "@/services/types";
|
||||||
import { IBlock } from "@/types/block.types";
|
import { IBlock } from "@/types/block.types";
|
||||||
import { ICategory, ICategoryAttributes } from "@/types/category.types";
|
import { ICategory } from "@/types/category.types";
|
||||||
import { BlockPorts } from "@/types/visual-editor.types";
|
import { BlockPorts } from "@/types/visual-editor.types";
|
||||||
|
|
||||||
import BlockDialog from "../BlockDialog";
|
import BlockDialog from "../BlockDialog";
|
||||||
import { ZOOM_LEVEL } from "../constants";
|
import { ZOOM_LEVEL } from "../constants";
|
||||||
import { useVisualEditor } from "../hooks/useVisualEditor";
|
import { useVisualEditor } from "../hooks/useVisualEditor";
|
||||||
import useDebouncedUpdate from "@/hooks/useDebouncedUpdate";
|
|
||||||
|
|
||||||
const Diagrams = () => {
|
const Diagrams = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -115,7 +114,6 @@ const Diagrams = () => {
|
|||||||
const { mutateAsync: updateBlock } = useUpdate(EntityType.BLOCK, {
|
const { mutateAsync: updateBlock } = useUpdate(EntityType.BLOCK, {
|
||||||
invalidate: false,
|
invalidate: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const debouncedUpdateCategory = useDebouncedUpdate(updateCategory, 300);
|
const debouncedUpdateCategory = useDebouncedUpdate(updateCategory, 300);
|
||||||
const debouncedZoomEvent = useCallback(
|
const debouncedZoomEvent = useCallback(
|
||||||
(event: any) => {
|
(event: any) => {
|
||||||
@ -130,7 +128,7 @@ const Diagrams = () => {
|
|||||||
}
|
}
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
},
|
},
|
||||||
[selectedCategoryId, debouncedUpdateCategory],
|
[selectedCategoryId, engine, debouncedUpdateCategory],
|
||||||
);
|
);
|
||||||
const debouncedOffsetEvent = useCallback(
|
const debouncedOffsetEvent = useCallback(
|
||||||
(event: any) => {
|
(event: any) => {
|
||||||
@ -146,7 +144,6 @@ const Diagrams = () => {
|
|||||||
},
|
},
|
||||||
[selectedCategoryId, debouncedUpdateCategory],
|
[selectedCategoryId, debouncedUpdateCategory],
|
||||||
);
|
);
|
||||||
|
|
||||||
const getBlockFromCache = useGetFromCache(EntityType.BLOCK);
|
const getBlockFromCache = useGetFromCache(EntityType.BLOCK);
|
||||||
const updateCachedBlock = useUpdateCache(EntityType.BLOCK);
|
const updateCachedBlock = useUpdateCache(EntityType.BLOCK);
|
||||||
const deleteCachedBlock = useDeleteFromCache(EntityType.BLOCK);
|
const deleteCachedBlock = useDeleteFromCache(EntityType.BLOCK);
|
||||||
|
|||||||
@ -11,7 +11,6 @@ function useDebouncedUpdate(
|
|||||||
delay: number = 300,
|
delay: number = 300,
|
||||||
) {
|
) {
|
||||||
const accumulatedUpdates = useRef<DebouncedUpdateParams | null>(null);
|
const accumulatedUpdates = useRef<DebouncedUpdateParams | null>(null);
|
||||||
|
|
||||||
const processUpdates = useRef(
|
const processUpdates = useRef(
|
||||||
debounce(() => {
|
debounce(() => {
|
||||||
if (accumulatedUpdates.current) {
|
if (accumulatedUpdates.current) {
|
||||||
@ -20,7 +19,6 @@ function useDebouncedUpdate(
|
|||||||
}
|
}
|
||||||
}, delay),
|
}, delay),
|
||||||
).current;
|
).current;
|
||||||
|
|
||||||
const handleUpdate = useCallback(
|
const handleUpdate = useCallback(
|
||||||
(params: DebouncedUpdateParams) => {
|
(params: DebouncedUpdateParams) => {
|
||||||
accumulatedUpdates.current = {
|
accumulatedUpdates.current = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user