File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ const MapsSection = ({
37
37
const [ isLoading , setLoading ] = useState < boolean > ( false ) ;
38
38
const [ currentVisu , setCurrentVisu ] = useState < IEEInfo > ( defaultEEInfo ) ;
39
39
const [ imageData , setImageData ] = useState < IMapInfo > ( {
40
- name : "cisterna " ,
40
+ name : "" ,
41
41
year : "general" ,
42
42
} ) ;
43
43
const [ pinMap , setPinMap ] = useState < boolean > ( false ) ;
@@ -88,18 +88,20 @@ const MapsSection = ({
88
88
} , [ currentVisu , tiffInfo , pinMap ] ) ;
89
89
90
90
useEffect ( ( ) => {
91
- if ( tiffInfo . length != 0 ) {
91
+ if ( tiffInfo . length !== 0 ) {
92
92
setCurrentVisu ( tiffInfo . map ( ( map ) => map . fields ) [ 0 ] ) ;
93
93
}
94
94
} , [ tiffInfo ] ) ;
95
95
96
96
useEffect ( ( ) => {
97
- setImageData ( {
98
- name : currentVisu . id ,
99
- year : Object . keys ( currentVisu . imageData ) [
100
- Object . keys ( currentVisu . imageData ) . length - 1
101
- ] ,
102
- } ) ;
97
+ if ( currentVisu . id ) {
98
+ setImageData ( {
99
+ name : currentVisu . id ,
100
+ year : Object . keys ( currentVisu . imageData ) [
101
+ Object . keys ( currentVisu . imageData ) . length - 1
102
+ ] ,
103
+ } ) ;
104
+ }
103
105
} , [ currentVisu ] ) ;
104
106
105
107
return (
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export const sections: ISections = {
70
70
} ;
71
71
72
72
export const defaultEEInfo : IEEInfo = {
73
- id : "default " ,
73
+ id : "" ,
74
74
name : "--" ,
75
75
description : "--" ,
76
76
imageData : {
You can’t perform that action at this time.
0 commit comments