mirror of
https://github.com/flarum/core.git
synced 2025-08-09 18:07:02 +02:00
Initialise component state in init() instead of constructor
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user