From 513fc1e2faac736bcefe71aba64e74196524001d Mon Sep 17 00:00:00 2001
From: Determinant <ted.sybil@gmail.com>
Date: Thu, 14 Feb 2019 13:38:33 -0500
Subject: ...

---
 src/Settings.tsx | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

(limited to 'src/Settings.tsx')

diff --git a/src/Settings.tsx b/src/Settings.tsx
index 83f1da6..1626a7a 100644
--- a/src/Settings.tsx
+++ b/src/Settings.tsx
@@ -155,13 +155,9 @@ class Settings extends React.Component {
             data: ['trackedPeriods']
         }).then(msg => {
             let config = {
-                trackedPeriods: msg.data.trackedPeriods.map(p => {
-                    return {
-                        start: Duration.inflate(p.start),
-                        end: Duration.inflate(p.end),
-                        name: p.name
-                    };
-                })
+                trackedPeriods: msg.data.trackedPeriods.map((p: TrackPeriodFlat) => (
+                    new TrackPeriod.inflate(p);
+                ))
             };
             console.log(msg.data.trackedPeriods);
             this.setState({ config });
@@ -298,11 +294,7 @@ class Settings extends React.Component {
     updateTrackedPeriods = trackedPeriods => {
         this.msgClient.sendMsg({
             type: MsgType.updateConfig,
-            data: { trackedPeriods: trackedPeriods.map(p => ({
-                name: p.name,
-                start: p.start.deflate(),
-                end: p.end.deflate()
-            })) }
+            data: { trackedPeriods: trackedPeriods.map(p => p.deflate())) }
         }).then(() => this.setState({...this.state.config, trackedPeriods }));
     }
 
-- 
cgit v1.2.3

