Remove duplicate device counting logic by consolidating three identical implementations into a single reusable function. **Changes:** - Refactor agent_live/index.ex mount/3 to use calculate_device_counts/1 - Delete duplicate calculate_cloud_poller_counts/1 function - Replace all usages with calculate_device_counts/1 **Before:** - Lines 31-47: Inline counting for agent_tokens and cloud_pollers - Lines 312-318: calculate_device_counts/1 - Lines 320-326: calculate_cloud_poller_counts/1 (identical logic) **After:** - Single calculate_device_counts/1 function used everywhere - ~20 lines removed **Benefits:** - Eliminates triple duplication of counting logic - Single source of truth for device counting - Easier to maintain and test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| channels | ||
| components | ||
| controllers | ||
| helpers | ||
| live | ||
| plugs | ||
| endpoint.ex | ||
| gettext.ex | ||
| gettext_helpers.ex | ||
| permissions.ex | ||
| plug_exceptions.ex | ||
| router.ex | ||
| telemetry.ex | ||
| user_auth.ex | ||