From 206e53346318f1f42afd623949b290b242f8580b Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Thu, 3 Oct 2019 12:36:03 +0800 Subject: [PATCH] fix: update data after action --- lib/screens/repository.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/screens/repository.dart b/lib/screens/repository.dart index bd070c2..52b786a 100644 --- a/lib/screens/repository.dart +++ b/lib/screens/repository.dart @@ -17,8 +17,6 @@ import 'package:git_touch/screens/object.dart'; import 'package:git_touch/widgets/repository_item.dart'; import '../widgets/entry_item.dart'; import '../screens/issues.dart'; -import '../screens/user.dart'; -import '../screens/organization.dart'; import 'package:git_touch/widgets/action_button.dart'; class RepositoryScreen extends StatelessWidget { @@ -140,10 +138,11 @@ class RepositoryScreen extends StatelessWidget { .deleteWithCredentials('/user/starred/$owner/$name'); data[0]['viewerHasStarred'] = false; } else { - Provider.of(context) + await Provider.of(context) .putWithCredentials('/user/starred/$owner/$name'); data[0]['viewerHasStarred'] = true; } + payload.refresh(); }, ), ActionItem( @@ -156,10 +155,11 @@ class RepositoryScreen extends StatelessWidget { '/repos/$owner/$name/subscription'); data[0]['viewerSubscription'] = 'UNSUBSCRIBED'; } else { - Provider.of(context) + await Provider.of(context) .putWithCredentials('/repos/$owner/$name/subscription'); data[0]['viewerSubscription'] = 'SUBSCRIBED'; } + payload.refresh(); }, ), ],