Skip to content

Commit 87f1147

Browse files
machourchinesedfan
authored andcommitted
fix(crash): don't navigate to issue if it's a release notification (#673)
* fix(crash): don't navigate to issue if it's a release notification * refactor: filter out releases in getTitleComponentProps * revert: cancel all changes
1 parent 777ac29 commit 87f1147

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/notification-list-item.component.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const IconStyled = styled(Icon).attrs({
5757
const SubjectType = {
5858
commit: 'Commit',
5959
pull: 'PullRequest',
60+
release: 'Release',
6061
};
6162

6263
export class NotificationListItem extends Component {
@@ -76,6 +77,8 @@ export class NotificationListItem extends Component {
7677
return 'git-commit';
7778
case SubjectType.pull:
7879
return 'git-pull-request';
80+
case SubjectType.release:
81+
return 'tag';
7982
default:
8083
return 'issue-opened';
8184
}
@@ -84,7 +87,8 @@ export class NotificationListItem extends Component {
8487
getTitleComponentProps = () => {
8588
const { notification, navigationAction } = this.props;
8689

87-
return notification.subject.type === SubjectType.commit
90+
return notification.subject.type === SubjectType.commit ||
91+
notification.subject.type === SubjectType.release
8892
? {}
8993
: {
9094
onPress: () => navigationAction(notification),

0 commit comments

Comments
 (0)