mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 05:13:37 +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.
|
* to create or edit a tag.
|
||||||
*/
|
*/
|
||||||
export default class EditTagModal extends Modal {
|
export default class EditTagModal extends Modal {
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
super.init();
|
||||||
|
|
||||||
this.tag = this.props.tag || app.store.createRecord('tags');
|
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';
|
import sortTags from 'flarum/tags/utils/sortTags';
|
||||||
|
|
||||||
export default class TagDiscussionModal extends Modal {
|
export default class TagDiscussionModal extends Modal {
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
super.init();
|
||||||
|
|
||||||
this.tags = sortTags(app.store.all('tags').filter(tag => tag.canStartDiscussion()));
|
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';
|
import sortTags from 'flarum/tags/utils/sortTags';
|
||||||
|
|
||||||
export default class TagsPage extends Component {
|
export default class TagsPage extends Component {
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
|
||||||
|
|
||||||
this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));
|
this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));
|
||||||
|
|
||||||
app.current = this;
|
app.current = this;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user