mirror of
https://github.com/git-touch/git-touch
synced 2025-01-19 10:49:49 +01:00
fix: update data after action
This commit is contained in:
parent
966fa824ed
commit
206e533463
@ -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<AuthModel>(context)
|
||||
await Provider.of<AuthModel>(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<AuthModel>(context)
|
||||
await Provider.of<AuthModel>(context)
|
||||
.putWithCredentials('/repos/$owner/$name/subscription');
|
||||
data[0]['viewerSubscription'] = 'SUBSCRIBED';
|
||||
}
|
||||
payload.refresh();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user