From e06982674e1cbfe5fa3c8809e124ba3d1eb88dfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niklas=20Schr=C3=B6tler?= <niklas@allround.digital>
Date: Mon, 11 Dec 2023 19:47:05 +0100
Subject: [PATCH] FahrplanPanel: Fixed keys of different lines colliding

---
 src/panels/Fahrplan/FahrplanPanel.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/panels/Fahrplan/FahrplanPanel.tsx b/src/panels/Fahrplan/FahrplanPanel.tsx
index e687e8c..fff3715 100644
--- a/src/panels/Fahrplan/FahrplanPanel.tsx
+++ b/src/panels/Fahrplan/FahrplanPanel.tsx
@@ -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: [
               {
-- 
GitLab