@@ -11,7 +11,12 @@ import {
1111 DialogTrigger ,
1212} from "@/components/ui/dialog" ;
1313import { SidebarMenuButton } from "@/components/ui/sidebar-l" ;
14- import { addQuestion , isLoading , leafletMapContext } from "@/lib/context" ;
14+ import {
15+ addQuestion ,
16+ defaultCustomQuestions ,
17+ isLoading ,
18+ leafletMapContext ,
19+ } from "@/lib/context" ;
1520
1621export const AddQuestionDialog = ( {
1722 children,
@@ -59,7 +64,14 @@ export const AddQuestionDialog = ({
5964 const center = map . getCenter ( ) ;
6065 addQuestion ( {
6166 id : "tentacles" ,
62- data : { lat : center . lat , lng : center . lng } ,
67+ data : defaultCustomQuestions . get ( )
68+ ? {
69+ lat : center . lat ,
70+ lng : center . lng ,
71+ locationType : "custom" ,
72+ places : [ ] ,
73+ }
74+ : { lat : center . lat , lng : center . lng } ,
6375 } ) ;
6476 return true ;
6577 } ;
@@ -70,7 +82,9 @@ export const AddQuestionDialog = ({
7082 const center = map . getCenter ( ) ;
7183 addQuestion ( {
7284 id : "matching" ,
73- data : { lat : center . lat , lng : center . lng } ,
85+ data : defaultCustomQuestions . get ( )
86+ ? { lat : center . lat , lng : center . lng , type : "custom-points" }
87+ : { lat : center . lat , lng : center . lng } ,
7488 } ) ;
7589 return true ;
7690 } ;
@@ -81,7 +95,9 @@ export const AddQuestionDialog = ({
8195 const center = map . getCenter ( ) ;
8296 addQuestion ( {
8397 id : "measuring" ,
84- data : { lat : center . lat , lng : center . lng } ,
98+ data : defaultCustomQuestions . get ( )
99+ ? { lat : center . lat , lng : center . lng , type : "custom-measure" }
100+ : { lat : center . lat , lng : center . lng } ,
85101 } ) ;
86102 return true ;
87103 } ;
0 commit comments