1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 01:16:52 +02:00

forum/components/Notification: Support external links

This commit is contained in:
Alexander Skvortsov
2020-08-10 18:09:33 -04:00
committed by Franz Liedke
parent d1b0030292
commit 81fd986881

View File

@@ -19,10 +19,13 @@ export default class Notification extends Component {
const notification = this.attrs.notification;
const href = this.href();
const linkAttrs = {};
linkAttrs[href.indexOf('://') === -1 ? 'route' : 'href'] = href;
return (
<a
className={'Notification Notification--' + notification.contentType() + ' ' + (!notification.isRead() ? 'unread' : '')}
route={href}
{...linkAttrs}
onclick={this.markAsRead.bind(this)}
>
{!notification.isRead() &&