File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -111,21 +111,23 @@ const Repositories = ({ repositories }) => (
111111 </ ul >
112112) ;
113113
114- const Watch = ( { repository } ) => (
114+ const Watch = ( {
115+ repository : { id, viewerSubscription, watchers } ,
116+ } ) => (
115117 < Mutation
116118 mutation = { WATCH_REPOSITORY }
117119 variables = { {
118- id : repository . id ,
119- viewerSubscription : isWatch ( repository . viewerSubscription )
120+ id,
121+ viewerSubscription : isWatch ( viewerSubscription )
120122 ? VIEWER_SUBSCRIPTIONS . UNSUBSCRIBED
121123 : VIEWER_SUBSCRIPTIONS . SUBSCRIBED ,
122124 } }
123125 update = { updateWatch }
124126 >
125127 { ( updateSubscription , { data, loading, error } ) => (
126128 < button type = "button" onClick = { updateSubscription } >
127- { repository . watchers . totalCount } { ' ' }
128- { isWatch ( repository . viewerSubscription ) ? 'Unwatch' : 'Watch' }
129+ { watchers . totalCount } { ' ' }
130+ { isWatch ( viewerSubscription ) ? 'Unwatch' : 'Watch' }
129131 </ button >
130132 ) }
131133 </ Mutation >
You can’t perform that action at this time.
0 commit comments