Skip to content

Commit

Permalink
Fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RProduction committed Jun 19, 2021
1 parent 6ae1bcc commit af705a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
"darwin",
"mac",
"linux"
]
},
{
Expand Down
14 changes: 5 additions & 9 deletions src/components/OverallChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
VictoryGroup,
VictoryZoomContainer,
VictoryBrushContainer,
VictoryAxis
VictoryAxis,
} from 'victory';

import { Money } from '../models/Money';
Expand All @@ -25,14 +25,10 @@ type OverallChartProps = {
value: Money[]
}

interface Domain {

}

function OverallChart({ value }: OverallChartProps) {
const styles = useStyles();
const [selectedDomain, setSelectedDomain] = useState<any>([]);
const [zoomDomain, setZoomDomain] = useState<any>([]);
const [selectedDomain, setSelectedDomain] = useState<any>();
const [zoomDomain, setZoomDomain] = useState<any>();

const handleZoom = (domain: any) => {
setSelectedDomain(domain);
Expand All @@ -55,8 +51,8 @@ function OverallChart({ value }: OverallChartProps) {
});

let tick: Date[] = [];
let minYear = data[0].x.getFullYear();
const maxYear = data[data.length-1].x.getFullYear();
let minYear = data.length > 0 ? data[0].x.getFullYear() : 0;
const maxYear = data.length > 0 ? data[data.length-1].x.getFullYear() : 0;
while(minYear <= maxYear) {
tick.push(new Date(minYear, 1, 1));
minYear += 1;
Expand Down
6 changes: 5 additions & 1 deletion src/states/MoneyState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ const income = selector({
key: 'incomeSelector',
get: ({get}) => {
const value = get(moneyOverall);
return value[value.length-1].type === "increase" ? value[value.length-1].value : 0 ;

if(value.length > 0)
return value[value.length-1].type === "increase" ? value[value.length-1].value : 0 ;
else
return 0;
}
})

Expand Down

0 comments on commit af705a3

Please sign in to comment.