@@ -72,8 +72,6 @@ export const ManageApps: React.FC<IManageAppsProps> = (props: IManageAppsProps)
72
72
// const ToolbarRevokeManagedObjectButtonLabel = 'Revoke';
73
73
const ToolbarDeleteManagedObjectButtonLabel = 'Delete' ;
74
74
75
- // /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
76
- // const [configContext, dispatchConfigContext] = React.useContext(ConfigContext);
77
75
const [ componentState , setComponentState ] = React . useState < TComponentState > ( initialComponentState ) ;
78
76
const [ isLoading , setIsLoading ] = React . useState < boolean > ( false ) ;
79
77
const [ apiCallStatus , setApiCallStatus ] = React . useState < TApiCallState | null > ( null ) ;
@@ -82,12 +80,14 @@ export const ManageApps: React.FC<IManageAppsProps> = (props: IManageAppsProps)
82
80
const [ viewManagedObject , setViewManagedObject ] = React . useState < TViewManagedObject > ( ) ;
83
81
const [ showListComponent , setShowListComponent ] = React . useState < boolean > ( false ) ;
84
82
const [ showViewComponent , setShowViewComponent ] = React . useState < boolean > ( false ) ;
85
- const [ refreshViewComponentKey , setRefreshViewComponentKey ] = React . useState < number > ( 0 ) ;
86
83
const [ viewAppApiAppResponse , setViewAppApiAppResponse ] = React . useState < AppResponse > ( ) ;
87
84
const [ showApproveComponent , setShowApproveComponent ] = React . useState < boolean > ( false ) ;
88
85
const [ showRevokeComponent , setShowRevokeComponent ] = React . useState < boolean > ( false ) ;
89
86
const [ showDeleteComponent , setShowDeleteComponent ] = React . useState < boolean > ( false ) ;
90
87
const [ showEditAttributesComponent , setShowEditAttributesComponent ] = React . useState < boolean > ( false ) ;
88
+ const [ refreshCounter , setRefreshCounter ] = React . useState < number > ( 0 ) ;
89
+
90
+ // const [refreshViewComponentKey, setRefreshViewComponentKey] = React.useState<number>(0);
91
91
92
92
// * useEffect Hooks *
93
93
React . useEffect ( ( ) => {
@@ -249,16 +249,19 @@ export const ManageApps: React.FC<IManageAppsProps> = (props: IManageAppsProps)
249
249
const onApproveManagedObjectSuccess = ( apiCallState : TApiCallState ) => {
250
250
setApiCallStatus ( apiCallState ) ;
251
251
setNewComponentState ( E_COMPONENT_STATE . MANAGED_OBJECT_VIEW ) ;
252
- setRefreshViewComponentKey ( refreshViewComponentKey + 1 ) ;
252
+ setRefreshCounter ( refreshCounter + 1 ) ;
253
+ // setRefreshViewComponentKey(refreshViewComponentKey + 1);
253
254
}
254
255
const onRevokeManagedObjectSuccess = ( apiCallState : TApiCallState ) => {
255
256
setApiCallStatus ( apiCallState ) ;
256
257
setNewComponentState ( E_COMPONENT_STATE . MANAGED_OBJECT_VIEW ) ;
257
- setRefreshViewComponentKey ( refreshViewComponentKey + 1 ) ;
258
+ setRefreshCounter ( refreshCounter + 1 ) ;
259
+ // setRefreshViewComponentKey(refreshViewComponentKey + 1);
258
260
}
259
261
const onDeleteManagedObjectSuccess = ( apiCallState : TApiCallState ) => {
260
262
setApiCallStatus ( apiCallState ) ;
261
263
setNewComponentState ( E_COMPONENT_STATE . MANAGED_OBJECT_LIST_VIEW ) ;
264
+ setRefreshCounter ( refreshCounter + 1 ) ;
262
265
}
263
266
const onSubComponentSuccess = ( apiCallState : TApiCallState ) => {
264
267
setApiCallStatus ( apiCallState ) ;
@@ -349,7 +352,7 @@ export const ManageApps: React.FC<IManageAppsProps> = (props: IManageAppsProps)
349
352
350
353
{ showListComponent &&
351
354
< ListApps
352
- key = { componentState . previousState }
355
+ key = { refreshCounter }
353
356
organizationId = { props . organizationId }
354
357
onSuccess = { onListManagedObjectsSuccess }
355
358
onError = { onSubComponentError }
@@ -362,7 +365,7 @@ export const ManageApps: React.FC<IManageAppsProps> = (props: IManageAppsProps)
362
365
{ showViewComponent && managedObjectId && managedObjectDisplayName &&
363
366
viewManagedObject && viewManagedObject . appListItem . appType && viewManagedObject . appListItem . ownerId &&
364
367
< ViewApp
365
- key = { refreshViewComponentKey }
368
+ key = { refreshCounter }
366
369
organizationId = { props . organizationId }
367
370
appId = { managedObjectId }
368
371
appDisplayName = { managedObjectDisplayName }
0 commit comments