From a78539fc61ac3af5cb77835ebda44c22e03ac524 Mon Sep 17 00:00:00 2001 From: Marie Birner Date: Sun, 1 Oct 2023 18:44:44 +0200 Subject: [PATCH] [BUGFIX] stats typescript --- frontend/logbook.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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;