Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

689 B
Raw Blame
import { useEffect } from 'react';

import { useResourceManagerStore } from '@/features/ResourceManager/store';
import type { FilesTabs } from '@/types/files';

interface ResetSelectionOnQueryChangeOptions {
  category: FilesTabs;
  currentFolderId?: string | null;
  libraryId?: string;
  searchQuery: string | null;
}

export const useResetSelectionOnQueryChange = ({
  category,
  currentFolderId,
  libraryId,
  searchQuery,
}: ResetSelectionOnQueryChangeOptions) => {
  const clearSelectAllState = useResourceManagerStore((s) => s.clearSelectAllState);

  useEffect(() => {
    clearSelectAllState();
  }, [category, clearSelectAllState, currentFolderId, libraryId, searchQuery]);
};