mirror of
https://github.com/git-touch/git-touch
synced 2025-01-31 08:04:51 +01:00
fix(gt): me screen login
This commit is contained in:
parent
2557ad2d07
commit
890c44c4c5
@ -83,7 +83,7 @@ class _HomeState extends State<Home> {
|
||||
case 0:
|
||||
return GtOrgsScreen();
|
||||
case 1:
|
||||
return GtUserScreen(null);
|
||||
return GtUserScreen(auth.activeAccount.login, isViewer: true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -20,21 +20,20 @@ class GtUserScreenPayload {
|
||||
|
||||
class GtUserScreen extends StatelessWidget {
|
||||
final String login;
|
||||
GtUserScreen(this.login);
|
||||
bool get isViewer => login == null;
|
||||
final bool isViewer;
|
||||
GtUserScreen(this.login, {this.isViewer = false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RefreshStatefulScaffold<GtUserScreenPayload>(
|
||||
title: Text(login ?? 'Me'),
|
||||
title: Text(isViewer ? 'Me' : login),
|
||||
fetchData: () async {
|
||||
final auth = context.read<AuthModel>();
|
||||
final res = await Future.wait([
|
||||
auth.fetchGitea(isViewer ? '/user' : '/users/$login'),
|
||||
auth.fetchGitea(
|
||||
isViewer ? '/user/repos?limit=6' : '/users/$login/repos?limit=6'),
|
||||
auth.fetchGitea(
|
||||
'/users/${login ?? auth.activeAccount.login}/heatmap'),
|
||||
auth.fetchGitea('/users/$login/heatmap'),
|
||||
auth.fetchGitea('/orgs/$login'),
|
||||
auth.fetchGitea('/orgs/$login/repos'),
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user