File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
plugins/confluence-plugin/src/components Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,11 @@ const PageContent: React.FC = () => {
36
36
) ;
37
37
38
38
const entityPages = useMemo ( ( ) : EntityPageI [ ] => {
39
- if ( ! entityDefinition ) return [ ] ;
39
+ if ( ! entityDefinition ) {
40
+ return [ ] ;
41
+ }
40
42
const entityPages : EntityPageI [ ] = [ ] ;
43
+
41
44
if ( Array . isArray ( entityDefinition . info ?. [ "x-cortex-confluence" ] ?. pages ) ) {
42
45
for ( const page of entityDefinition . info [ "x-cortex-confluence" ] . pages ) {
43
46
const id = page . id as string ;
@@ -47,6 +50,7 @@ const PageContent: React.FC = () => {
47
50
}
48
51
}
49
52
}
53
+
50
54
if ( entityDefinition . info ?. [ "x-cortex-confluence" ] ?. pageID ) {
51
55
entityPages . push ( {
52
56
id : `${ entityDefinition . info [ "x-cortex-confluence" ] . pageID as string } ` ,
@@ -79,9 +83,17 @@ const PageContent: React.FC = () => {
79
83
}
80
84
} , [ context . entity ?. tag ] ) ;
81
85
82
- if ( isLoading ) return < Loading /> ;
83
- if ( ! baseConfluenceUrl ) return < Instructions /> ;
84
- if ( errorStr ) return < Notice > { errorStr } </ Notice > ;
86
+ if ( isLoading ) {
87
+ return < Loading /> ;
88
+ }
89
+
90
+ if ( ! baseConfluenceUrl ) {
91
+ return < Instructions /> ;
92
+ }
93
+
94
+ if ( errorStr ) {
95
+ return < Notice > { errorStr } </ Notice > ;
96
+ }
85
97
86
98
if ( isNil ( entityPage ) ) {
87
99
return (
You can’t perform that action at this time.
0 commit comments