mirror of
https://github.com/flarum/framework.git
synced 2025-06-06 07:54:32 +08:00
Initialise component state in init() instead of constructor
This commit is contained in:
@ -6,9 +6,7 @@ import icon from 'flarum/helpers/icon';
|
|||||||
import humanTime from 'flarum/helpers/humanTime';
|
import humanTime from 'flarum/helpers/humanTime';
|
||||||
|
|
||||||
export default class FlagList extends Component {
|
export default class FlagList extends Component {
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the notifications are loading.
|
* Whether or not the notifications are loading.
|
||||||
*
|
*
|
||||||
|
@ -2,8 +2,8 @@ import Modal from 'flarum/components/Modal';
|
|||||||
import Button from 'flarum/components/Button';
|
import Button from 'flarum/components/Button';
|
||||||
|
|
||||||
export default class FlagPostModal extends Modal {
|
export default class FlagPostModal extends Modal {
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
super.init();
|
||||||
|
|
||||||
this.reason = m.prop('');
|
this.reason = m.prop('');
|
||||||
this.reasonDetail = m.prop('');
|
this.reasonDetail = m.prop('');
|
||||||
|
@ -10,8 +10,8 @@ export default class FlagsDropdown extends NotificationsDropdown {
|
|||||||
super.initProps(props);
|
super.initProps(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
super.init();
|
||||||
|
|
||||||
this.list = new FlagList();
|
this.list = new FlagList();
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,8 @@ import FlagList from 'flarum/flags/components/FlagList';
|
|||||||
* used on mobile devices where the flags dropdown is within the drawer.
|
* used on mobile devices where the flags dropdown is within the drawer.
|
||||||
*/
|
*/
|
||||||
export default class FlagsPage extends Page {
|
export default class FlagsPage extends Page {
|
||||||
constructor(...args) {
|
init() {
|
||||||
super(...args);
|
super.init();
|
||||||
|
|
||||||
app.history.push('flags');
|
app.history.push('flags');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user