Skip to content

Commit

Permalink
fix(github): cross reference event
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Oct 8, 2020
1 parent 85d5cad commit 0d722f0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/widgets/timeline_item.dart
Expand Up @@ -103,12 +103,19 @@ class TimelineItem extends StatelessWidget {
case 'IssueComment':
return CommentItem.gh(p);
case 'CrossReferencedEvent':
final number = p['source']['number'] as int;
final owner = p['source']['repository']['owner']['login'] as String;
final name = p['source']['repository']['name'] as String;
final prefix = p['source']['__typename'] == 'Issue' ? 'issues' : 'pull';
return TimelineEventItem(
actor: p['actor']['login'],
iconData: Octicons.primitive_dot,
iconColor: GithubPalette.open,
textSpan: TextSpan(
text: ' referenced this on #' + p['source']['number'].toString()),
textSpan: TextSpan(children: [
TextSpan(text: ' referenced this on '),
createLinkSpan(context, '$owner/$name#$number',
'/github/$owner/$name/$prefix/$number'),
]),
p: p,
);
case 'ClosedEvent':
Expand Down

0 comments on commit 0d722f0

Please sign in to comment.