11import core from 'core' ;
22import getHashParams from 'helpers/getHashParams' ;
33import getAnnotationRelatedElements from 'helpers/getAnnotationRelatedElements' ;
4+ import { PRIORITY_THREE , PRIORITY_ONE } from 'constants/actionPriority' ;
45import actions from 'actions' ;
56
67export default store => {
@@ -18,7 +19,7 @@ export default store => {
1819const disableElementsPassedByConstructor = ( state , dispatch ) => {
1920 if ( state . advanced . defaultDisabledElements ) {
2021 const elements = state . advanced . defaultDisabledElements . split ( ',' ) ;
21- dispatch ( actions . disableElements ( elements ) ) ;
22+ dispatch ( actions . disableElements ( elements , PRIORITY_THREE ) ) ;
2223 }
2324} ;
2425
@@ -29,7 +30,7 @@ const disableElementsIfReadOnly = (state, dispatch) => {
2930 ...getAnnotationRelatedElements ( state )
3031 ] ;
3132
32- dispatch ( actions . disableElements ( elements ) ) ;
33+ dispatch ( actions . disableElements ( elements , PRIORITY_ONE ) ) ;
3334 core . setToolMode ( 'AnnotationEdit' ) ;
3435 }
3536} ;
@@ -43,7 +44,7 @@ const disableElementsIfAnnotationDisabled = (state, dispatch) => {
4344 ...getAnnotationRelatedElements ( state ) ,
4445 ] ;
4546
46- dispatch ( actions . disableElements ( elements ) ) ;
47+ dispatch ( actions . disableElements ( elements , PRIORITY_ONE ) ) ;
4748 }
4849} ;
4950
@@ -56,7 +57,7 @@ const disableElementsIfFilePickerDisabled = dispatch => {
5657 'filePickerButton' ,
5758 ] ;
5859
59- dispatch ( actions . disableElements ( elements ) ) ;
60+ dispatch ( actions . disableElements ( elements , PRIORITY_ONE ) ) ;
6061 }
6162} ;
6263
@@ -70,14 +71,14 @@ const disableElementsIfHideAnnotationPanel = dispatch => {
7071 'annotationCommentButton'
7172 ] ;
7273
73- dispatch ( actions . disableElements ( elements ) ) ;
74+ dispatch ( actions . disableElements ( elements , PRIORITY_ONE ) ) ;
7475 }
7576} ;
7677
7778const disableElementsIfToolBarDisabled = dispatch => {
7879 const toolBarDisabled = ! getHashParams ( 'toolbar' , true ) ;
7980
8081 if ( toolBarDisabled ) {
81- dispatch ( actions . disableElement ( 'header' ) ) ;
82+ dispatch ( actions . disableElement ( 'header' , PRIORITY_ONE ) ) ;
8283 }
8384} ;
0 commit comments