clean feed / list url

This commit is contained in:
lesion 2022-01-17 12:03:05 +01:00
parent ee26630e4d
commit e0d43d4ae9
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -142,11 +142,11 @@ export default {
}, },
link () { link () {
const typeMap = ['rss', 'ics', 'list'] const typeMap = ['rss', 'ics']
const params = [] const params = []
if (this.filters.tags.length) { if (this.filters.tags.length) {
params.push(`tags=${this.filters.tags.join(',')}`) params.push(`tags=${this.filters.tags.map(encodeURIComponent).join(',')}`)
} }
if (this.filters.places.length) { if (this.filters.places.length) {
@ -157,7 +157,7 @@ export default {
params.push('show_recurrent=true') params.push('show_recurrent=true')
} }
return `${this.settings.baseurl}/feed/${typeMap[this.type]}?${params.join('&')}` return `${this.settings.baseurl}/feed/${typeMap[this.type]}${params.length ? '?' : ''}${params.join('&')}`
}, },
showLink () { showLink () {
return (['rss', 'ics'].includes(this.type)) return (['rss', 'ics'].includes(this.type))