mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +02:00
feat: frontend Model
extender (#3646)
* feat: reintroduce frontend extenders * chore: used `Routes` extender in bundled extensions * chore: used `PostTypes` extender in bundled extensions * chore: `yarn format` * feat: `Model` frontend extender * chore: naming * chore(review): attributes can be nullable or undefined * chore(review): delay extender implementation * chore(review): unnecessary check * chore(review): stay consistent * chore: merge conflicts * chore: unused import * chore: multiline extenders * feat: add Store extender Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import Extend from 'flarum/common/extenders';
|
||||
import IndexPage from 'flarum/forum/components/IndexPage';
|
||||
import Discussion from 'flarum/common/models/Discussion';
|
||||
|
||||
export default [new Extend.Routes().add('following', '/following', IndexPage)];
|
||||
export default [
|
||||
new Extend.Routes() //
|
||||
.add('following', '/following', IndexPage),
|
||||
|
||||
new Extend.Model(Discussion) //
|
||||
.attribute('subscription'),
|
||||
];
|
||||
|
@@ -16,8 +16,6 @@ export { default as extend } from './extend';
|
||||
app.initializers.add('subscriptions', function () {
|
||||
app.notificationComponents.newPost = NewPostNotification;
|
||||
|
||||
Discussion.prototype.subscription = Model.attribute('subscription');
|
||||
|
||||
addSubscriptionBadge();
|
||||
addSubscriptionControls();
|
||||
addSubscriptionFilter();
|
||||
|
Reference in New Issue
Block a user