File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 55 Stack ,
66 type UseFileUploadReturn ,
77} from "@chakra-ui/react" ;
8- import { useState } from "react" ;
8+ import { useEffect , useState } from "react" ;
99import type { StacLink } from "stac-ts" ;
1010import useStacMap from "../hooks/stac-map" ;
1111import type { SetHref } from "../types/app" ;
@@ -27,11 +27,16 @@ export default function Panel({
2727 setHref : SetHref ;
2828 fileUpload : UseFileUploadReturn ;
2929} ) {
30- const { value, picked } = useStacMap ( ) ;
30+ const { value, picked, setPicked , setItems } = useStacMap ( ) ;
3131 const [ search , setSearch ] = useState < StacSearch > ( ) ;
3232 const [ searchLink , setSearchLink ] = useState < StacLink > ( ) ;
3333 const [ autoLoad , setAutoLoad ] = useState ( false ) ;
3434
35+ useEffect ( ( ) => {
36+ setItems ( undefined ) ;
37+ setPicked ( undefined ) ;
38+ } , [ search , setPicked , setItems ] ) ;
39+
3540 let content ;
3641 if ( ! href ) {
3742 content = (
You can’t perform that action at this time.
0 commit comments