@@ -19,7 +19,7 @@ const removingSelector = (state) => get(state, "annotations.removing");
1919const closingSelector = ( state ) => ! ! get ( state , "annotations.closing" ) ;
2020const editingSelector = ( state ) => get ( state , "annotations.editing" ) ;
2121const currentSelector = ( state ) => get ( state , "annotations.current" ) ;
22- const modeSelector = ( state ) => editingSelector ( state ) && 'editing' || currentSelector ( state ) && 'detail' || 'list' ;
22+ const modeSelector = ( state ) => editingSelector ( state ) && 'editing' || annotationsLayerSelector ( state ) && currentSelector ( state ) && 'detail' || 'list' ;
2323
2424const annotationsInfoSelector = ( state ) => ( assign ( { } , {
2525 editing : editingSelector ( state ) ,
@@ -40,11 +40,12 @@ const annotationsSelector = (state) => ({
4040const annotationsListSelector = createSelector ( [
4141 annotationsInfoSelector ,
4242 annotationsSelector ,
43- annotationsLayerSelector
44- ] , ( info , annotations , layer ) => ( assign ( { } , {
43+ annotationsLayerSelector ,
44+ modeSelector
45+ ] , ( info , annotations , layer , mode ) => ( assign ( { } , {
4546 removing : annotations . removing ,
4647 closing : ! ! annotations . closing ,
47- mode : annotations . editing && 'editing' || annotations . current && 'detail' || 'list' ,
48+ mode,
4849 annotations : layer && layer . features || [ ] ,
4950 current : annotations . current || null ,
5051 editing : info . editing ,
@@ -61,6 +62,7 @@ const annotationSelector = createSelector([annotationsListSelector], (annotation
6162} ) ;
6263
6364module . exports = {
65+ modeSelector,
6466 annotationsLayerSelector,
6567 annotationsInfoSelector,
6668 annotationsSelector,
0 commit comments