mirror of
https://github.com/zoriya/flood.git
synced 2025-12-20 22:25:16 +00:00
Introduce uiSettings DB
This commit is contained in:
@@ -2,8 +2,10 @@ import _ from 'lodash';
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
|
||||
import EventTypes from '../../constants/EventTypes';
|
||||
import TextboxRepeater from '../forms/TextboxRepeater';
|
||||
import TorrentActions from '../../actions/TorrentActions';
|
||||
import UIStore from '../../stores/UIStore';
|
||||
|
||||
const METHODS_TO_BIND = [
|
||||
'getContent',
|
||||
@@ -11,7 +13,8 @@ const METHODS_TO_BIND = [
|
||||
'handleUrlAdd',
|
||||
'handleUrlChange',
|
||||
'handleUrlRemove',
|
||||
'handleAddTorrents'
|
||||
'handleAddTorrents',
|
||||
'onLatestTorrentLocationChange'
|
||||
];
|
||||
|
||||
export default class AddTorrents extends React.Component {
|
||||
@@ -29,6 +32,23 @@ export default class AddTorrents extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.setState({destination: UIStore.getLatestTorrentLocation()});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
UIStore.listen(EventTypes.UI_LATEST_TORRENT_LOCATION_CHANGE, this.onLatestTorrentLocationChange);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
UIStore.unlisten(EventTypes.UI_LATEST_TORRENT_LOCATION_CHANGE, this.onLatestTorrentLocationChange);
|
||||
UIStore.fetchLatestTorrentLocation();
|
||||
}
|
||||
|
||||
onLatestTorrentLocationChange() {
|
||||
this.setState({destination: UIStore.getLatestTorrentLocation()});
|
||||
}
|
||||
|
||||
getContent() {
|
||||
return (
|
||||
<div className="modal__content" onClick={this.handleMenuWrapperClick}>
|
||||
|
||||
Reference in New Issue
Block a user