-
Notifications
You must be signed in to change notification settings - Fork 509
fix(agenda): Agenda 'now' fallback to next event if there is no current event #8693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
client/agenda/AgendaQuickAccess.vue
Outdated
if (lastEventId) { | ||
document.getElementById(`agenda-rowid-${lastEventId}`)?.scrollIntoView(true) | 8000||
if (nowEventId) { | ||
document.getElementById(`agenda-rowid-${nowEventId}`)?.scrollIntoView(true) | ||
} else { | ||
message.warning('There is no event happening right now.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing "or in the future" to be consistent with AgendaMobileBar
client/agenda/store.js
Outdated
findNowEventId () { | ||
const currentEventId = this.findCurrentEventId() | ||
|
||
if (currentEventId) return currentEventId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add curly braces.
client/agenda/store.js
Outdated
if (sh.adjustedStart > current) { | ||
// -> Use the first event of multiple events having identical times | ||
if (nextEvent.start === sh.adjustedStart.toMillis()) { | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use break instead? No need to keep iterating, as events are already chronological.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've simplified this loop ... see 52678da
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8693 +/- ##
==========================================
- Coverage 88.88% 88.80% -0.08%
==========================================
Files 312 314 +2
Lines 40891 41243 +352
==========================================
+ Hits 36345 36626 +281
- Misses 4546 4617 +71 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The 'now' internal page link would fail if there was no current event. For example, clicking 'now' before
events start for the day would fail. This PR adds a fallback where it will find the next event even if it hasn't started yet.