Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Infoscreen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evy Storozhenko
Infoscreen
Commits
d298ebc5
Commit
d298ebc5
authored
1 year ago
by
Niklas Schrötler
Browse files
Options
Downloads
Patches
Plain Diff
FahrplanPanel: Now filtering stops that are 5h in the future
This prevents key collisions
parent
780c74e7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/panels/Fahrplan/FahrplanPanel.tsx
+6
-1
6 additions, 1 deletion
src/panels/Fahrplan/FahrplanPanel.tsx
with
6 additions
and
1 deletion
src/panels/Fahrplan/FahrplanPanel.tsx
+
6
−
1
View file @
d298ebc5
...
@@ -52,6 +52,11 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => {
...
@@ -52,6 +52,11 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => {
const
delay
=
stringToDelay
(
departure
.
delay
);
const
delay
=
stringToDelay
(
departure
.
delay
);
const
arrival
=
processArrival
(
departure
.
sched_date
,
departure
.
time
);
const
arrival
=
processArrival
(
departure
.
sched_date
,
departure
.
time
);
// Throw away stops that are five hours in the future as keys start colliding at some point
if
(
arrival
.
getTime
()
>=
5
*
60
*
60
*
1000
+
(
new
Date
()).
getTime
())
{
continue
;
}
if
(
existing_ind
===
-
1
)
{
if
(
existing_ind
===
-
1
)
{
// If it does not exist, create a new route
// If it does not exist, create a new route
newRoutes
.
push
({
newRoutes
.
push
({
...
@@ -69,7 +74,7 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => {
...
@@ -69,7 +74,7 @@ const FahrplanPanel = (props: {definition: FahrplanPanelDefinition}) => {
countdown
:
parseInt
(
departure
.
countdown
)
countdown
:
parseInt
(
departure
.
countdown
)
})
})
}
else
{
}
else
{
// If it does
n't
, just add a stop to the existing route
// If it does, just add a stop to the existing route
newRoutes
[
existing_ind
].
stops
.
push
({
newRoutes
[
existing_ind
].
stops
.
push
({
name
:
departure
.
internal
.
stop
,
name
:
departure
.
internal
.
stop
,
arrival
,
arrival
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment