@@ -14,8 +14,9 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
1414 const [ is_dashboard , setIsDashboard ] = useState ( false ) ;
1515 const [ app_register_modal_open , setAppRegisterModalOpen ] = useState ( false ) ;
1616 const [ current_updating_item , setCurrentUpdateItem ] = useState ( { } ) ;
17- const { getAllApps, apps : updatedApps } = useGetApps ( ) ;
17+ const { getAllApps, apps : updatedApps , error } = useGetApps ( ) ;
1818 const { is_authorized } = useAuthContext ( ) ;
19+ const [ is_dashboard_blocked , setIsDashboardBlocked ] = useState ( false ) ;
1920
2021 const getApps = useCallback ( ( ) => {
2122 if ( is_authorized ) {
@@ -32,6 +33,12 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
3233 }
3334 } , [ ] ) ;
3435
36+ useEffect ( ( ) => {
37+ if ( error ?. error ?. code === 'AppList' ) {
38+ setIsDashboardBlocked ( true ) ;
39+ }
40+ } , [ error ] ) ;
41+
3542 const handleCurrentUpdatingItem = useCallback ( ( item : ApplicationObject ) => {
3643 setCurrentUpdateItem ( item ) ;
3744 } , [ ] ) ;
@@ -52,6 +59,7 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
5259 app_register_modal_open,
5360 handleCurrentUpdatingItem,
5461 current_updating_item,
62+ is_dashboard_blocked,
5563 } ;
5664 } , [
5765 apps ,
@@ -64,6 +72,7 @@ const AppManagerContextProvider = ({ children }: TAppManagerContextProps) => {
6472 setAppRegisterModalOpen ,
6573 handleCurrentUpdatingItem ,
6674 current_updating_item ,
75+ is_dashboard_blocked ,
6776 ] ) ;
6877
6978 return < AppManagerContext . Provider value = { context_object } > { children } </ AppManagerContext . Provider > ;
0 commit comments