diff --git a/frontend/logbook.ts b/frontend/logbook.ts index ce698a6..ea4e194 100644 --- a/frontend/logbook.ts +++ b/frontend/logbook.ts @@ -5,14 +5,8 @@ export interface Data { km: number; } -let data = [ - { date: new Date('2023-01-01'), km: 5 }, - { date: new Date('2023-02-01'), km: 24 }, - { date: new Date('2023-08-30'), km: 4000 }, -]; - if(sessionStorage.getItem('userStats')) { - data = JSON.parse(sessionStorage.getItem('userStats') as Data[]); + const data = JSON.parse(sessionStorage.getItem('userStats') || '{}') as Data[]; const margin = { top: 20, right: 20, bottom: 50, left: 50 }; const width: number = 960 - margin.left - margin.right;