@@ -36,6 +36,7 @@ import {
3636 DuplicateActionModal ,
3737 RenameActionModal ,
3838} from './dashboard-action-modals' ;
39+ import { useEditableProjects } from './hooks/useEditableProjects' ;
3940const perPageOptions = [
4041 { title : '10' , value : 10 } ,
4142 { title : '20' , value : 20 } ,
@@ -58,7 +59,9 @@ const DashboardActionsCell = React.memo(
5859 emptyActions : any [ ] ;
5960 } ) => {
6061 const { t } = useTranslation ( process . env . I18N_NAMESPACE ) ;
61- const { canEdit, loading } = usePersesEditPermissions ( project ) ;
62+
63+ const { permissionsLoading } = useEditableProjects ( ) ;
64+ const { canEdit } = usePersesEditPermissions ( project ) ;
6265 const disabled = ! canEdit ;
6366
6467 const rowSpecificActions = useMemo (
@@ -79,7 +82,7 @@ const DashboardActionsCell = React.memo(
7982 [ dashboard , onRename , onDuplicate , onDelete , t ] ,
8083 ) ;
8184
82- if ( disabled || loading ) {
85+ if ( disabled ) {
8386 return (
8487 < Tooltip content = { t ( "You don't have permissions for dashboard actions" ) } >
8588 < div >
@@ -88,6 +91,15 @@ const DashboardActionsCell = React.memo(
8891 </ Tooltip >
8992 ) ;
9093 }
94+ if ( permissionsLoading ) {
95+ return (
96+ < Tooltip content = { t ( 'Permissions are loading' ) } >
97+ < div >
98+ < ActionsColumn items = { emptyActions } isDisabled = { true } />
99+ </ div >
100+ </ Tooltip >
101+ ) ;
102+ }
91103
92104 return < ActionsColumn items = { rowSpecificActions } isDisabled = { false } /> ;
93105 } ,
0 commit comments