mirror of
https://github.com/zoriya/flood.git
synced 2026-05-31 02:15:12 +00:00
Move dependency registration to constructor
This commit is contained in:
@@ -37,9 +37,7 @@ class FloodApp extends React.Component {
|
||||
METHODS_TO_BIND.forEach((method) => {
|
||||
this[method] = this[method].bind(this);
|
||||
});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UIStore.registerDependency({
|
||||
id: 'flood-settings',
|
||||
message: (
|
||||
|
||||
@@ -18,7 +18,9 @@ import TrackerFilters from '../Sidebar/TrackerFilters';
|
||||
import UIStore from '../../stores/UIStore';
|
||||
|
||||
class Sidebar extends React.Component {
|
||||
componentDidMount() {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
UIStore.registerDependency({
|
||||
id: 'torrent-taxonomy',
|
||||
message: (
|
||||
@@ -26,6 +28,9 @@ class Sidebar extends React.Component {
|
||||
defaultMessage="Torrent Taxonomy" />
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
TorrentStore.listen(EventTypes.CLIENT_TORRENTS_REQUEST_SUCCESS,
|
||||
this.onTorrentRequestSuccess);
|
||||
TorrentFilterStore.listen(EventTypes.CLIENT_FETCH_TORRENT_TAXONOMY_SUCCESS,
|
||||
|
||||
@@ -83,9 +83,7 @@ class NotificationsButton extends React.Component {
|
||||
METHODS_TO_BIND.forEach((method) => {
|
||||
this[method] = this[method].bind(this);
|
||||
});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UIStore.registerDependency({
|
||||
id: 'notifications',
|
||||
message: (
|
||||
|
||||
@@ -33,9 +33,7 @@ class TransferData extends React.Component {
|
||||
METHODS_TO_BIND.forEach((method) => {
|
||||
this[method] = this[method].bind(this);
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
UIStore.registerDependency([
|
||||
{
|
||||
id: 'transfer-data',
|
||||
@@ -52,6 +50,9 @@ class TransferData extends React.Component {
|
||||
)
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({
|
||||
sidebarWidth: ReactDOM.findDOMNode(this).offsetWidth
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ const METHODS_TO_BIND = [
|
||||
let cachedTorrentList = null;
|
||||
|
||||
class TorrentListContainer extends React.Component {
|
||||
constructor() {
|
||||
constructor(props) {
|
||||
super();
|
||||
|
||||
this.lastScrollPosition = 0;
|
||||
@@ -76,13 +76,14 @@ class TorrentListContainer extends React.Component {
|
||||
this.setScrollPosition = _.throttle(this.setScrollPosition, 250, {
|
||||
trailing: true
|
||||
});
|
||||
|
||||
UIStore.registerDependency({
|
||||
id: 'torrent-list',
|
||||
message: props.intl.formatMessage(MESSAGES.torrentListDependency)
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
UIStore.registerDependency({
|
||||
id: 'torrent-list',
|
||||
message: this.props.intl.formatMessage(MESSAGES.torrentListDependency)
|
||||
});
|
||||
TorrentStore.listen(EventTypes.UI_TORRENT_SELECTION_CHANGE, this.onTorrentSelectionChange);
|
||||
TorrentStore.listen(EventTypes.CLIENT_TORRENTS_REQUEST_SUCCESS, this.onReceiveTorrentsSuccess);
|
||||
TorrentStore.listen(EventTypes.UI_TORRENTS_LIST_FILTERED, this.onReceiveTorrentsSuccess);
|
||||
|
||||
Reference in New Issue
Block a user