Added dfault fallback to the geoLocation

This commit is contained in:
Luca 2020-10-22 18:06:23 +02:00
parent bf2737b947
commit 7dff578422
1 changed files with 5 additions and 2 deletions

View File

@ -652,7 +652,10 @@ export default Vue.extend({
this.currentLocale = this.$i18n.locale this.currentLocale = this.$i18n.locale
this.currentGeoLocation = this.$i18n.geoLocation this.currentGeoLocation = this.$i18n.geoLocation
if (this.currentGeoLocation === undefined) {
this.updateGeoLocationNames(this.currentLocale) this.updateGeoLocationNames(this.currentLocale)
this.currentGeoLocation = 'us'
}
}, },
beforeDestroy: function () { beforeDestroy: function () {
if (this.invidiousInstance === '') { if (this.invidiousInstance === '') {
@ -697,7 +700,7 @@ export default Vue.extend({
} }
const countries = JSON.parse(fileData).map((entry) => { return { id: entry.id, name: entry.name, code: entry.alpha2 } }) const countries = JSON.parse(fileData).map((entry) => { return { id: entry.id, name: entry.name, code: entry.alpha2 } })
countries.sort((a, b) => { return a.id - b.id }) countries.sort((a, b) => { return a.id - b.id })
this.geoLocationArray = countries this.geoLocationArray = countriess
}, },
...mapActions([ ...mapActions([