fix: filter custom date select toggle (#4244)

This commit is contained in:
Anmol Singh Bhatia 2024-04-23 12:56:21 +05:30 committed by GitHub
parent 5d8c5b22e8
commit beff8536c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 79 additions and 10 deletions

View file

@ -43,12 +43,12 @@ export const ArchivedModulesHeader: FC = observer(() => {
const handleFilters = useCallback(
(key: keyof TModuleFilters, value: string | string[]) => {
if (!projectId) return;
const newValues = currentProjectArchivedFilters?.[key] ?? [];
if (Array.isArray(value))
value.forEach((val) => {
if (!newValues.includes(val)) newValues.push(val);
else newValues.splice(newValues.indexOf(val), 1);
});
else {
if (currentProjectArchivedFilters?.[key]?.includes(value)) newValues.splice(newValues.indexOf(value), 1);