File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change @@ -16,11 +16,13 @@ const getters = {
1616
1717// actions
1818const 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 ) {
Original file line number Diff line number Diff 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 },
You can’t perform that action at this time.
0 commit comments