Skip to content
Snippets Groups Projects
Commit e0698267 authored by Niklas Schrötler's avatar Niklas Schrötler
Browse files

FahrplanPanel: Fixed keys of different lines colliding

parent 47e8773a
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ import PanelTitle from "../../meta/PanelTitle";
import PanelContent from "../../meta/PanelContent";
import {StationResponse} from "./types/vrrfAPI";
import {Warning} from "@phosphor-icons/react";
import {AnimatePresence, motion} from 'framer-motion';
import {motion} from 'framer-motion';
export type FahrplanPanelDefinition = {
stops: string[],
......@@ -47,7 +47,7 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => {
}
// Find existing route with same uid
const existing_ind = newRoutes.findIndex(r => r.uid === departure.key)
const existing_ind = newRoutes.findIndex(r => r.uid === departure.key + "-" + departure.lineref.identifier)
// Pre-compute values that will be needed regardless
const delay = stringToDelay(departure.delay);
......@@ -61,8 +61,8 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => {
if(existing_ind === -1) {
// If it does not exist, create a new route
newRoutes.push({
uid: departure.key,
heading: departure.lineref.direction,
uid: departure.key + "-" + departure.lineref.identifier,
heading: departure.destination,
identifier: departure.line,
stops: [
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment