fix: check if issue or pull request
This commit is contained in:
parent
fd206993a1
commit
980bbf9f30
|
@ -41,11 +41,14 @@ class ActionItem {
|
||||||
Provider.of<ThemeModel>(context)
|
Provider.of<ThemeModel>(context)
|
||||||
.pushRoute(context, (_) => RepositoryScreen(owner, name));
|
.pushRoute(context, (_) => RepositoryScreen(owner, name));
|
||||||
});
|
});
|
||||||
ActionItem.issue(String owner, String name, int number)
|
ActionItem.issue(String owner, String name, int number,
|
||||||
: text = '#$number',
|
{isPullRequest = false})
|
||||||
|
: text = (isPullRequest ? 'Pull Request' : 'Issue') + ' #$number',
|
||||||
onPress = ((context) {
|
onPress = ((context) {
|
||||||
Provider.of<ThemeModel>(context)
|
Provider.of<ThemeModel>(context).pushRoute(
|
||||||
.pushRoute(context, (_) => IssueScreen(owner, name, number));
|
context,
|
||||||
|
(_) => IssueScreen(owner, name, number,
|
||||||
|
isPullRequest: isPullRequest));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,8 @@ class EventItem extends StatelessWidget {
|
||||||
ActionItem.user(event.actorLogin),
|
ActionItem.user(event.actorLogin),
|
||||||
ActionItem.user(event.repoOwner),
|
ActionItem.user(event.repoOwner),
|
||||||
ActionItem.repository(event.repoOwner, event.repoName),
|
ActionItem.repository(event.repoOwner, event.repoName),
|
||||||
ActionItem.issue(event.repoOwner, event.repoName, number),
|
ActionItem.issue(event.repoOwner, event.repoName, number,
|
||||||
|
isPullRequest: isPullRequest),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
case 'IssuesEvent':
|
case 'IssuesEvent':
|
||||||
|
@ -305,7 +306,8 @@ class EventItem extends StatelessWidget {
|
||||||
ActionItem.user(event.actorLogin),
|
ActionItem.user(event.actorLogin),
|
||||||
ActionItem.user(event.repoOwner),
|
ActionItem.user(event.repoOwner),
|
||||||
ActionItem.repository(event.repoOwner, event.repoName),
|
ActionItem.repository(event.repoOwner, event.repoName),
|
||||||
ActionItem.issue(event.repoOwner, event.repoName, number),
|
ActionItem.issue(event.repoOwner, event.repoName, number,
|
||||||
|
isPullRequest: true),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
case 'PullRequestReviewEvent':
|
case 'PullRequestReviewEvent':
|
||||||
|
@ -333,7 +335,8 @@ class EventItem extends StatelessWidget {
|
||||||
ActionItem.user(event.actorLogin),
|
ActionItem.user(event.actorLogin),
|
||||||
ActionItem.user(event.repoOwner),
|
ActionItem.user(event.repoOwner),
|
||||||
ActionItem.repository(event.repoOwner, event.repoName),
|
ActionItem.repository(event.repoOwner, event.repoName),
|
||||||
ActionItem.issue(event.repoOwner, event.repoName, number),
|
ActionItem.issue(event.repoOwner, event.repoName, number,
|
||||||
|
isPullRequest: true),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
case 'PushEvent':
|
case 'PushEvent':
|
||||||
|
|
Loading…
Reference in New Issue