Change default table view to be displayed only after data fetch
[arvados-workbench2.git] / src / views / favorite-panel / favorite-panel.tsx
index 73849562dad12f34c4153188f0d9e6cd5ce8180c..4ba967c0529a37b5142f13bc6648e1b3e3b14a01 100644 (file)
@@ -164,23 +164,18 @@ export const FavoritePanel = withStyles(styles)(
     connect(mapStateToProps, mapDispatchToProps)(
         class extends React.Component<FavoritePanelProps> {
             render() {
-                return this.hasAnyFavorites()
-                    ? <DataExplorer
-                        id={FAVORITE_PANEL_ID}
-                        onRowClick={this.props.onItemClick}
-                        onRowDoubleClick={this.props.onItemDoubleClick}
-                        onContextMenu={this.props.onContextMenu}
-                        contextMenuColumn={true}
-                        dataTableDefaultView={<DataTableDefaultView icon={FavoriteIcon}/>} />
-                    : <PanelDefaultView
-                        icon={FavoriteIcon}
-                        messages={['Your favorites list is empty.']} />;
-            }
-
-            hasAnyFavorites = () => {
-                return Object
-                    .keys(this.props.favorites)
-                    .find(uuid => this.props.favorites[uuid]);
+                return <DataExplorer
+                    id={FAVORITE_PANEL_ID}
+                    onRowClick={this.props.onItemClick}
+                    onRowDoubleClick={this.props.onItemDoubleClick}
+                    onContextMenu={this.props.onContextMenu}
+                    contextMenuColumn={true}
+                    dataTableDefaultView={
+                        <DataTableDefaultView
+                            icon={FavoriteIcon}
+                            messages={['Your favorites list is empty.']}
+                            />
+                    } />;
             }
         }
     )