mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 08:50:47 +08:00
Initialise component state in init() instead of constructor
This commit is contained in:
parent
41985eb0c3
commit
dc6eb4d4ad
|
@ -6,9 +6,7 @@ import icon from 'flarum/helpers/icon';
|
|||
import humanTime from 'flarum/helpers/humanTime';
|
||||
|
||||
export default class FlagList extends Component {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
init() {
|
||||
/**
|
||||
* Whether or not the notifications are loading.
|
||||
*
|
||||
|
|
|
@ -2,8 +2,8 @@ import Modal from 'flarum/components/Modal';
|
|||
import Button from 'flarum/components/Button';
|
||||
|
||||
export default class FlagPostModal extends Modal {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
this.reason = m.prop('');
|
||||
this.reasonDetail = m.prop('');
|
||||
|
|
|
@ -10,8 +10,8 @@ export default class FlagsDropdown extends NotificationsDropdown {
|
|||
super.initProps(props);
|
||||
}
|
||||
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
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.
|
||||
*/
|
||||
export default class FlagsPage extends Page {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
init() {
|
||||
super.init();
|
||||
|
||||
app.history.push('flags');
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user