[Dashboard] Fix Bug in Machine View when Unsorted with Multiple Machines (#9938)

* Patch issue where when the Machine view was unsorted and grouped, it would crash.

* lint

Co-authored-by: Max Fitton <max@semprehealth.com>
This commit is contained in:
Max Fitton
2020-08-06 10:38:01 -07:00
committed by SangBin Cho
parent 9c19b14b1e
commit ccd383bcd5
@@ -70,7 +70,9 @@ const makeGroupedTableContents = (
rayletInfo: RayletInfoResponse | null,
nodeInfoFeatures: NodeInfoFeature[],
) => {
const sortedGroups = stableSort(nodes, sortGroupComparator);
const sortedGroups = sortGroupComparator
? stableSort(nodes, sortGroupComparator)
: nodes;
return sortedGroups.map((node) => {
const workerFeatureData: WorkerFeatureData[] = node.workers.map(
(worker) => {
@@ -183,7 +185,6 @@ const NodeInfo: React.FC<{}> = () => {
const [orderBy, setOrderBy] = React.useState<nodeInfoColumnId | null>(null);
const classes = useNodeInfoStyles();
const { nodeInfo, rayletInfo } = useSelector(nodeInfoSelector);
if (nodeInfo === null || rayletInfo === null) {
return <Typography color="textSecondary">Loading...</Typography>;
}