diff --git a/extensions/likes/js/bootstrap.js b/extensions/likes/js/bootstrap.js index c8d53ab40..440149814 100644 --- a/extensions/likes/js/bootstrap.js +++ b/extensions/likes/js/bootstrap.js @@ -3,6 +3,7 @@ import app from 'flarum/app'; import Post from 'flarum/models/post'; import Model from 'flarum/model'; import DiscussionPage from 'flarum/components/discussion-page'; +import SettingsPage from 'flarum/components/settings-page'; import ActionButton from 'flarum/components/action-button'; import CommentPost from 'flarum/components/comment-post'; import punctuate from 'flarum/helpers/punctuate'; @@ -97,4 +98,12 @@ app.initializers.add('flarum-likes', function() { ); }); + // Add a notification preference. + extend(SettingsPage.prototype, 'notificationTypes', function(items) { + items.add('postLiked', { + name: 'postLiked', + label: [icon('thumbs-o-up'), ' Someone likes my post'] + }); + }); + });