@@ -19,6 +19,14 @@ const isElementCaseOrStudy = (objectType: ElementType) => {
19
19
return objectType === ElementType . STUDY || objectType === ElementType . CASE ;
20
20
} ;
21
21
22
+ const creating = ( elementUuid , childrenMetadata ) => {
23
+ return (
24
+ ! childrenMetadata [ elementUuid ] ||
25
+ ( childrenMetadata [ elementUuid ] . type === ElementType . STUDY &&
26
+ ! childrenMetadata [ elementUuid ] . specificMetadata . caseFormat )
27
+ ) ;
28
+ } ;
29
+
22
30
const getDisplayedElementName = (
23
31
data : ElementAttributes ,
24
32
childrenMetadata : Record < UUID , ElementAttributes > ,
@@ -29,7 +37,7 @@ const getDisplayedElementName = (
29
37
if ( uploading ) {
30
38
return elementName + '\n' + formatMessage ( { id : 'uploading' } ) ;
31
39
}
32
- if ( ! childrenMetadata [ elementUuid ] ) {
40
+ if ( creating ( elementUuid , childrenMetadata ) ) {
33
41
return elementName + '\n' + formatMessage ( { id : 'creationInProgress' } ) ;
34
42
}
35
43
return childrenMetadata [ elementUuid ] . elementName ;
@@ -72,11 +80,11 @@ export const NameCellRenderer = ({
72
80
return (
73
81
< Box sx = { styles . tableCell } >
74
82
{ /* Icon */ }
75
- { ! childrenMetadata [ data . elementUuid ] &&
83
+ { creating ( data . elementUuid , childrenMetadata ) &&
76
84
isElementCaseOrStudy ( data . type ) && (
77
85
< CircularProgress size = { 18 } sx = { styles . circularRoot } />
78
86
) }
79
- { childrenMetadata [ data . elementUuid ] &&
87
+ { ! creating ( data . elementUuid , childrenMetadata ) &&
80
88
getFileIcon ( data . type , styles . icon ) }
81
89
{ /* Name */ }
82
90
< OverflowableText
0 commit comments