From c329543e663c7e3cf2fce7841ca1e2062aa7eaa3 Mon Sep 17 00:00:00 2001 From: ronreg-ribdev <56719257+ronreg-ribdev@users.noreply.github.com> Date: Wed, 3 Jun 2020 03:30:21 -0700 Subject: [PATCH] Fix json, handle routes response --- src/js/components/root.js | 15 ++++++--------- src/js/subscription.js | 4 ++++ urbit/app/bartinfo.hoon | 9 ++++++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/js/components/root.js b/src/js/components/root.js index b626ab4..50505a5 100644 --- a/src/js/components/root.js +++ b/src/js/components/root.js @@ -69,13 +69,13 @@ class RoutePlanner extends Component { constructor(props) { super(props); this.state = { - fromStation: null, - toStation: null, + fromStation: "", + toStation: "", }; } static getDerivedStateFromProps(props, state) { - if (state.fromStation === null && props.stations && props.stations[0]) { + if (state.fromStation === "" && props.stations && props.stations[0]) { const abbr = props.stations[0].abbr; return { fromStation: abbr, toStation: abbr}; } @@ -109,18 +109,15 @@ class RoutePlanner extends Component { } renderStationForm() { - let initialState = null; - if (this.props.stations && this.props.stations[0]) { - initialState = this.props.stations[0].abbr; - } + const receivedStations = this.props.stations; return (