Skip to content
Snippets Groups Projects
Commit 5db628e0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

use first map as default selection

parent f5232747
No related branches found
No related tags found
2 merge requests!264Resolve "add support for matomo",!250Resolve "Default value for radio button of image format and Submap"
import { ZERO } from '@/constants/common';
import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { loadingModelsSelector, modelsDataSelector } from '@/redux/models/models.selectors';
import { useContext } from 'react';
import { useContext, useState } from 'react';
import { CheckboxItem } from '@/components/Map/Drawer/ExportDrawer/CheckboxFilter/CheckboxFilter.types';
import { CheckboxFilter } from '../../CheckboxFilter';
import { CollapsibleSection } from '../../CollapsibleSection';
import { ExportContext } from '../ExportCompound.context';
......@@ -18,6 +19,16 @@ export const Submap = (): React.ReactNode => {
label: name,
}));
const options = useState<CheckboxItem[]>(mappedElementAnnotations);
if (
!isPending &&
currentSelectedModels.length === ZERO &&
options.length > ZERO &&
options[ZERO].length > ZERO
) {
setModels([options[ZERO][ZERO]]);
}
return (
<CollapsibleSection title="Submap">
{isPending && <p>Loading...</p>}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment