Skip to content

Commit

Permalink
fix DriveList empty state
Browse files Browse the repository at this point in the history
closes #403
  • Loading branch information
incognitojam committed Jul 26, 2023
1 parent 5337249 commit 64ad8a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Dashboard/DriveList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const DriveList = (props) => {
.filter((drive) => drive.end_time_utc_millis - drive.start_time_utc_millis >= 10_000);

let content;
if (!driveList.length) {
if (driveList.length === 0) {
content = <DriveListEmpty device={device} routes={routes} />;
} else {
content = (
Expand Down
5 changes: 2 additions & 3 deletions src/components/Dashboard/DriveListEmpty.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { Grid, Typography, withStyles } from '@material-ui/core';

import { useWindowWidth } from '../../hooks/window';
import { hasRoutesData } from '../../timeline/segments';

const styles = () => ({
zeroState: {
Expand All @@ -17,9 +16,9 @@ const DriveListEmpty = (props) => {

if (device && routes === null) {
zeroRidesEle = <Typography>Loading...</Typography>;
} else if (hasRoutesData(props) && routes?.length === 0) {
} else if (routes?.length === 0) {
zeroRidesEle = (
<Typography>Looks like you haven&apos;t driven in the selected time range.</Typography>
<Typography>No routes found in selected time range.</Typography>
);
}

Expand Down

0 comments on commit 64ad8a8

Please sign in to comment.