Add: Traffic info now shows disruption data as well. Format of new time needs to be rewritten

This commit is contained in:
williameriksson126 2020-12-10 11:15:17 +01:00
parent 2b8c08e082
commit 031829d4f9
3 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@
"situationNumber": "RT1",
"severity":"normal",
"title":"Stannar inte på dessa hållplatser",
"time":"01:00",
"affectedStopPoints":[
{
"gid": "9022014014020001",

View File

@ -2,6 +2,7 @@
"situationNumber": "RT2",
"severity":"normal",
"title":"Försening",
"time":"02:00",
"affectedStopPoints":[
{
"gid": "9021014014225000",

View File

@ -20,13 +20,18 @@ class DisruptionButton extends Button {
if(this.state.jsonLocation === "ex1"){
for (let stopPoint of ex1.affectedStopPoints) {
if(stopPoint.gid === globData.user.stoppointgid){
this.state.disruption = ex1
this.state.disruption = ex1;
console.log(globData.stop.departures[0])
globData.stop.departures[0].newTime = ex1.time
globData.stop.departures[0].trafficInfo = ex1.title;
}
}
} else if (this.state.jsonLocation === "ex2"){
for (let stopPoint of ex2.affectedStopPoints) {
if(stopPoint.gid === globData.user.stoppointgid){
this.state.disruption = ex2
globData.stop.departures[0].newTime = ex2.time
globData.stop.departures[0].trafficInfo = ex2.title;
}
}
}