|
|
@@ -63,23 +63,31 @@ export default {
|
|
63
|
63
|
PairingButton,
|
|
64
|
64
|
},
|
|
65
|
65
|
mixins: [mixins.profileMixin],
|
|
66
|
|
- data(){
|
|
67
|
|
- return {
|
|
|
66
|
+ data() {
|
|
|
67
|
+ return {
|
|
68
|
68
|
fetchedCards: [],
|
|
69
|
|
- offset: 0
|
|
|
69
|
+ offset: 0,
|
|
70
|
70
|
}
|
|
71
|
71
|
},
|
|
72
|
72
|
computed: {
|
|
73
|
73
|
cards() {
|
|
74
|
|
- let initialCards = currentProfile.queue.map(qProfile => convertToCard(qProfile))
|
|
75
|
|
- if(this.fetchedCards.length === 0) return initialCards
|
|
76
|
|
- return [...initialCards,...this.fetchedCards.map(qProfile => convertToCard(qProfile))]
|
|
|
74
|
+ let initialCards = currentProfile.queue.map(qProfile =>
|
|
|
75
|
+ convertToCard(qProfile),
|
|
|
76
|
+ )
|
|
|
77
|
+ if (this.fetchedCards.length === 0) return initialCards
|
|
|
78
|
+ return [
|
|
|
79
|
+ ...initialCards,
|
|
|
80
|
+ ...this.fetchedCards.map(qProfile => convertToCard(qProfile)),
|
|
|
81
|
+ ]
|
|
77
|
82
|
},
|
|
78
|
83
|
},
|
|
79
|
84
|
methods: {
|
|
80
|
|
- async onLoadMore(){
|
|
|
85
|
+ async onLoadMore() {
|
|
81
|
86
|
this.offset += 5 // fetch next batch with updated offset
|
|
82
|
|
- let newQueue = await fetchQueueByProfileId(currentProfile.id._value, 5, this.offset)
|
|
|
87
|
+ let newQueue = await fetchQueueByProfileId(
|
|
|
88
|
+ currentProfile.id._value,
|
|
|
89
|
+ this.offset,
|
|
|
90
|
+ )
|
|
83
|
91
|
this.fetchedCards.push(...newQueue) // update fetchedCards => recalculate cards
|
|
84
|
92
|
},
|
|
85
|
93
|
// this can be placed in utils/notification.js
|