New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Subscriptions] User setting to automatically follow discussions you start/reply to #310
Comments
I started working on this issue. Its almost done but i have question about the implementation. Referencing: flarum/subscriptions#6 Lets see subscriptions are managed in the subscriptions extension. I added 2 listeners here to add the setting and to listen to a new post. This works fine. Example on how i implemented the settings now: Add a new section to the settings list items.add('forum',
FieldSet.component({
label: app.translator.trans('core.forum.settings.forum'),
className: 'Settings-forum',
children: this.forumItems().toArray()
})
); Implement the items under the heading forumItems() {
const items = new ItemList();
items.add('followAfterReply',
Switch.component({
children: app.translator.trans('core.forum.settings.follow_after_reply'),
state: this.user.preferences().followAfterReply,
onchange: (value, component) => {
this.preferenceSaver('followAfterReply')(value, component);
}
})
);
return items;
} Everything works but i would like to move everything to the subscription extension. |
@petermein Looking great so far! Thanks for taking this on. I just committed a small change to core which will allow you to slow this switch into the "notifications" settings fieldset, right beneath the grid. I think this is the best place for it. You'll want to create a new file in js/forum/src (something like import { extend } from 'flarum/extend';
import SettingsPage from `flarum/components/SettingsPage`;
extend(SettingsPage.prototype, 'notificationsItems', function(items) {
items.add('followAfterReply', ...);
}); And don't forget to import it into main.js :) |
Update the subscriptions PR, but i don't like the ordering of the settings items. |
From @tobscure on July 28, 2015 6:46
What needs to be done:
followAfterReply
) using the RegisterUserPreferences event.settingsItems
method to add a new child to thenotifications
fieldset. That child should be a Switch which saves the followAfterReply preference.Copied from original issue: flarum/subscriptions#1
The text was updated successfully, but these errors were encountered: