Skip to content

Commit ebed3e7

Browse files
committed
Fix missing watchlist params on ADP dispatcher
1 parent b4e24e2 commit ebed3e7

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/api/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default {
2828
getDrafts() {
2929
return db.ref('drafts').once('value');
3030
},
31-
getWatchlist(draft, user, cb) {
31+
getWatchlist({ draft, user }, cb) {
3232
listenForValueEvents(`watchlists/${draft}/${user}`, cb);
3333
},
3434
addToWatchlist(draft, user, player) {

src/store/modules/watchlist.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ const getters = {
1616

1717
// actions
1818
const actions = {
19-
getWatchlist({ commit }, data) {
19+
getWatchlist({ commit }, { draft, user }) {
2020
if (state.watchlistReceived === false) {
21-
api.getWatchlist(data.draft, data.user, (watchlist) => {
22-
commit(types.RECEIVE_WATCHLIST, watchlist);
23-
});
21+
if (draft && user) {
22+
api.getWatchlist({ draft, user }, (watchlist) => {
23+
commit(types.RECEIVE_WATCHLIST, watchlist);
24+
});
25+
}
2426
}
2527
},
2628
addToWatchlist({ commit }, data) {

src/views/DraftBoardView.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export default {
130130
},
131131
computed: {
132132
...mapGetters([
133+
'currentUser',
133134
'boardView',
134135
'pickView',
135136
'currentDraft',
@@ -164,7 +165,10 @@ export default {
164165
this.SELECT_PICK_VIEW(view);
165166
166167
if (view === PickView.ADP) {
167-
this.$store.dispatch('getWatchlist');
168+
this.$store.dispatch('getWatchlist', {
169+
draft: this.currentDraft.id,
170+
user: this.currentUser.id,
171+
});
168172
}
169173
},
170174
},

0 commit comments

Comments
 (0)