File tree 2 files changed +25
-22
lines changed
discover/public/application/view_components/utils
home/public/application/components/homepage/sections
2 files changed +25
-22
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ export const useSearch = (services: DiscoverViewServices) => {
83
83
core,
84
84
toastNotifications,
85
85
osdUrlStateStorage,
86
+ chrome,
86
87
} = services ;
87
88
const timefilter = data . query . timefilter . timefilter ;
88
89
const fetchStateRef = useRef < {
Original file line number Diff line number Diff line change @@ -57,28 +57,30 @@ const render = renderFn(() => {
57
57
< EuiFlexGrid columns = { 4 } >
58
58
{ recentAccessed . slice ( 0 , 8 ) . map ( ( recentAccessItem : ChromeRecentlyAccessedHistoryItem ) => {
59
59
const recentWorkItem = itemType . filter ( ( item ) => item . type === recentAccessItem . type ) ;
60
- return (
61
- < EuiFlexItem >
62
- < EuiCard
63
- layout = "horizontal"
64
- title = { recentAccessItem . label }
65
- titleSize = "xs"
66
- description = {
67
- < >
68
- < EuiIcon
69
- size = "m"
70
- className = "recent-work-title-icon"
71
- type = { recentWorkItem [ 0 ] . icon }
72
- />
73
- { recentWorkItem [ 0 ] . name }
74
- < br />
75
- { 'Last updated ' + moment ( recentAccessItem ?. updatedAt ) . fromNow ( ) }
76
- </ >
77
- }
78
- onClick = { ( ) => navigateToUrl ( services . addBasePath ( recentAccessItem . link ) ) }
79
- />
80
- </ EuiFlexItem >
81
- ) ;
60
+ if ( recentWorkItem [ 0 ] ) {
61
+ return (
62
+ < EuiFlexItem >
63
+ < EuiCard
64
+ layout = "horizontal"
65
+ title = { recentAccessItem . label }
66
+ titleSize = "xs"
67
+ description = {
68
+ < >
69
+ < EuiIcon
70
+ size = "m"
71
+ className = "recent-work-title-icon"
72
+ type = { recentWorkItem [ 0 ] . icon }
73
+ />
74
+ { recentWorkItem [ 0 ] . name }
75
+ < br />
76
+ { 'Last updated ' + moment ( recentAccessItem ?. updatedAt ) . fromNow ( ) }
77
+ </ >
78
+ }
79
+ onClick = { ( ) => navigateToUrl ( services . addBasePath ( recentAccessItem . link ) ) }
80
+ />
81
+ </ EuiFlexItem >
82
+ ) ;
83
+ }
82
84
} ) }
83
85
</ EuiFlexGrid >
84
86
</ div >
You can’t perform that action at this time.
0 commit comments