Merge branch 'broken-favorites' into 'develop'

Fixed broken pagination on favorites

See merge request funkwhale/funkwhale!1046
This commit is contained in:
Eliot Berriot 2020-03-03 13:38:42 +01:00
commit ecc3ed3ac3
2 changed files with 7 additions and 6 deletions

View File

@ -92,18 +92,12 @@ export default {
Pagination Pagination
}, },
data() { data() {
let defaultOrdering = this.getOrderingFromString(
this.defaultOrdering || "-creation_date"
)
return { return {
results: null, results: null,
isLoading: false, isLoading: false,
nextLink: null, nextLink: null,
previousLink: null, previousLink: null,
page: parseInt(this.defaultPage), page: parseInt(this.defaultPage),
paginateBy: parseInt(this.defaultPaginateBy || 25),
orderingDirection: defaultOrdering.direction || "+",
ordering: defaultOrdering.field,
orderingOptions: [ orderingOptions: [
["creation_date", "creation_date"], ["creation_date", "creation_date"],
["title", "track_title"], ["title", "track_title"],
@ -117,6 +111,7 @@ export default {
this.$router.push({name: 'login', query: {next: this.$router.currentRoute.fullPath}}) this.$router.push({name: 'login', query: {next: this.$router.currentRoute.fullPath}})
} }
this.fetchFavorites(FAVORITES_URL) this.fetchFavorites(FAVORITES_URL)
}, },
mounted() { mounted() {
$(".ui.dropdown").dropdown() $(".ui.dropdown").dropdown()
@ -140,6 +135,7 @@ export default {
ordering: this.getOrderingAsString() ordering: this.getOrderingAsString()
} }
}) })
this.fetchFavorites(FAVORITES_URL)
}, },
fetchFavorites(url) { fetchFavorites(url) {
var self = this var self = this

View File

@ -87,6 +87,11 @@ export default {
orderingDirection: "-", orderingDirection: "-",
ordering: "creation_date", ordering: "creation_date",
}, },
"favorites": {
paginateBy: 50,
orderingDirection: "-",
ordering: "creation_date",
},
}, },
serviceWorker: { serviceWorker: {
refreshing: false, refreshing: false,