Fixing issue instance list not falling back (#2626)

- Expanded the fall-back to catch edge
cases where the instance list returns a
completely valid response of [] (an other-
wise useless response which doesn't throw
an error).
This commit is contained in:
Emma 2022-09-27 16:05:12 -04:00 committed by GitHub
parent c3f8a3561b
commit e2686dfe24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,9 @@ const actions = {
})
} catch (err) {
console.error(err)
}
// If the invidious instance fetch isn't returning anything interpretable
if (instances.length === 0) {
// Starts fallback strategy: read from static file
// And fallback to hardcoded entry(s) if static file absent
const fileName = 'invidious-instances.json'
@ -58,7 +61,6 @@ const actions = {
]
}
}
commit('setInvidiousInstancesList', instances)
},