Skip to content

Commit b50cb93

Browse files
authored
Issue 0 fix deepwork divide by zero (#195)
* Update to banner message to specify version * Fix "error" showing when no deep work is returned
1 parent 650f246 commit b50cb93

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

packages/app/src/components/Home/DeepWork.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ interface Props {
99
}
1010
const DeepWork = ({ selectedDate }: Props) => {
1111
const theme = useTheme()
12-
const {
13-
isLoading,
14-
isError,
15-
isEmpty,
16-
data: deepWork,
17-
} = useDeepWork(selectedDate)
12+
const { isLoading, isError, data: deepWork } = useDeepWork(selectedDate)
1813

1914
if (isLoading) return <CircularProgress />
20-
if (isError || isEmpty || !deepWork) return <div>Error</div>
15+
if (isError || !deepWork) return <div>Error</div>
2116
console.log(deepWork)
2217
const totalTime = deepWork.reduce((acc, curr) => acc + curr.flowTime, 0)
2318
return (

packages/app/src/components/Home/Time/TimeDataChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const TimeDataChart = ({
3333
<LinearProgress
3434
variant="determinate"
3535
value={remainingProgress > 100 ? 100 : remainingProgress}
36+
key={i}
3637
sx={{
3738
position: 'absolute',
3839
width: '100%',

packages/app/src/components/common/UpdateBanner/UpdateBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const UpdateBanner = () => {
3636
}
3737
const updateCommand = `
3838
npx codeclimbers startup:disable &&
39-
npx codeclimbers start
39+
npx codeclimbers@${remoteVersion.data} start
4040
`
4141
return (
4242
<Box sx={{ position: 'absolute', left: 15, bottom: 15 }}>

0 commit comments

Comments
 (0)