refactor(dashboard): drop redundant PLATFORM_ORDER and misleading optional chain
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -328,21 +328,15 @@ let refreshInterval = null
|
|||||||
const stats = computed(() => downloadsStore.stats)
|
const stats = computed(() => downloadsStore.stats)
|
||||||
const recentActivity = computed(() => downloadsStore.recentActivity)
|
const recentActivity = computed(() => downloadsStore.recentActivity)
|
||||||
|
|
||||||
// Fixed display order for platform health bars
|
|
||||||
const PLATFORM_ORDER = [
|
|
||||||
'patreon', 'subscribestar', 'hentaifoundry',
|
|
||||||
'discord', 'pixiv', 'deviantart',
|
|
||||||
]
|
|
||||||
|
|
||||||
// Read threshold from settings, default 5 if unset
|
// Read threshold from settings, default 5 if unset
|
||||||
const failureThreshold = computed(() =>
|
const failureThreshold = computed(() =>
|
||||||
settingsStore.settings?.['dashboard.failure_threshold'] ?? 5
|
settingsStore.settings['dashboard.failure_threshold'] ?? 5
|
||||||
)
|
)
|
||||||
|
|
||||||
// Per-platform health for platforms with ≥1 enabled source
|
// Per-platform health for platforms with ≥1 enabled source
|
||||||
const platformHealth = computed(() => {
|
const platformHealth = computed(() => {
|
||||||
const enabled = sourcesStore.sources.filter(s => s.enabled)
|
const enabled = sourcesStore.sources.filter(s => s.enabled)
|
||||||
return PLATFORM_ORDER
|
return supportedPlatforms
|
||||||
.map(platform => {
|
.map(platform => {
|
||||||
const sources = enabled.filter(s => s.platform === platform)
|
const sources = enabled.filter(s => s.platform === platform)
|
||||||
if (sources.length === 0) return null
|
if (sources.length === 0) return null
|
||||||
|
|||||||
Reference in New Issue
Block a user