mirror of
https://github.com/git-touch/git-touch
synced 2025-01-19 02:40:05 +01:00
feat: watch repository
This commit is contained in:
parent
0fe8fc5982
commit
488f5fc8f0
@ -157,7 +157,7 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
Provider.of<ThemeModel>(context).pushRoute(context, builder);
|
Provider.of<ThemeModel>(context).pushRoute(context, builder);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (data != null)
|
if (data != null) ...[
|
||||||
MyAction(
|
MyAction(
|
||||||
text: data[0]['viewerHasStarred'] ? 'Unstar' : 'Star',
|
text: data[0]['viewerHasStarred'] ? 'Unstar' : 'Star',
|
||||||
onPress: () async {
|
onPress: () async {
|
||||||
@ -172,7 +172,24 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
// TODO: watch
|
MyAction(
|
||||||
|
text: data[0]['viewerSubscription'] == 'SUBSCRIBED'
|
||||||
|
? 'Unwatch'
|
||||||
|
: 'Watch',
|
||||||
|
onPress: () async {
|
||||||
|
if (data[0]['viewerSubscription'] == 'SUBSCRIBED') {
|
||||||
|
await Provider.of<SettingsModel>(context)
|
||||||
|
.deleteWithCredentials(
|
||||||
|
'/repos/$owner/$name/subscription');
|
||||||
|
data[0]['viewerSubscription'] = 'UNSUBSCRIBED';
|
||||||
|
} else {
|
||||||
|
Provider.of<SettingsModel>(context)
|
||||||
|
.putWithCredentials('/repos/$owner/$name/subscription');
|
||||||
|
data[0]['viewerSubscription'] = 'SUBSCRIBED';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
MyAction(
|
MyAction(
|
||||||
text: 'Share',
|
text: 'Share',
|
||||||
onPress: () {
|
onPress: () {
|
||||||
|
Loading…
Reference in New Issue
Block a user