mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 21:11:55 +08:00
Initialise component state in init() instead of constructor
This commit is contained in:
parent
1d5a118951
commit
67c1d79c5c
|
@ -9,8 +9,8 @@ import tagLabel from 'flarum/tags/helpers/tagLabel';
|
|||
* to create or edit a tag.
|
||||
*/
|
||||
export default class EditTagModal extends Modal {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
this.tag = this.props.tag || app.store.createRecord('tags');
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ import tagIcon from 'flarum/tags/helpers/tagIcon';
|
|||
import sortTags from 'flarum/tags/utils/sortTags';
|
||||
|
||||
export default class TagDiscussionModal extends Modal {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
this.tags = sortTags(app.store.all('tags').filter(tag => tag.canStartDiscussion()));
|
||||
|
||||
|
|
|
@ -7,9 +7,7 @@ import tagLabel from 'flarum/tags/helpers/tagLabel';
|
|||
import sortTags from 'flarum/tags/utils/sortTags';
|
||||
|
||||
export default class TagsPage extends Component {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
init() {
|
||||
this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));
|
||||
|
||||
app.current = this;
|
||||
|
|
Loading…
Reference in New Issue
Block a user