Skip to content

Conversation

@Lasithih
Copy link

@Lasithih Lasithih commented Feb 7, 2026

Fix: Allow cycles parameter to accept 0 to disable auto-switching

Problem

The dashboard frontend currently parses the cycles input value using:

parseInt($(item).find('.cycles-input').val()) || 10

This causes 0 to be treated as falsy, defaulting to 10 instead of being accepted as a valid value.

Solution

Use the nullish coalescing operator to properly handle 0:

parseInt($(item).find('.cycles-input').val()) ?? 10

Backend Compatibility

The switcher script already supports 0 to skip refreshing:

# Only run refresh logic if cycle_target is greater than 0
if [ "$cycle_target" -gt 0 ]; then

Use Case

When displaying static dashboards (e.g., Grafana), disabling the xiosk-switcher service gets overridden on configuration updates. Setting cycles=0 provides a cleaner way to disable auto-switching without stopping the service.


Related to #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant