mirror of https://github.com/buster-so/buster.git
Update useDropzonesInternal.ts
This commit is contained in:
parent
12a619480a
commit
00f668852b
|
@ -44,6 +44,12 @@ export const useDropzonesInternal = ({
|
|||
|
||||
const { errorZone, setErrorZone, onDragOverCheckErrorZone } = useErrorZones();
|
||||
|
||||
const availableDropZone: DropZoneInternal = {
|
||||
id: SelectAxisContainerId.Available,
|
||||
title: 'Available',
|
||||
items: [] //empty array because we don't need to show items in the available zone
|
||||
};
|
||||
|
||||
const setDropZones = useMemo(() => {
|
||||
return (
|
||||
newDropZones: (prev: DropZoneInternal[]) => DropZoneInternal[],
|
||||
|
@ -242,8 +248,8 @@ export const useDropzonesInternal = ({
|
|||
return null;
|
||||
});
|
||||
|
||||
const findZoneById = useMemoizedFn((zoneId: string): DropZoneInternal | null => {
|
||||
return dropZones.find((zone) => zone.id === zoneId) || null;
|
||||
const findZoneById = useMemoizedFn((zoneId: string): DropZoneInternal => {
|
||||
return dropZones.find((zone) => zone.id === zoneId) || availableDropZone;
|
||||
});
|
||||
|
||||
const findZoneByOver = useMemoizedFn((over: Over): SelectAxisContainerId | null => {
|
||||
|
|
Loading…
Reference in New Issue