aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/components/Menu.react.js
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-07 00:00:37 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-07 00:00:37 +0200
commit181ee8dced7cccc687136c6f35faf2bff1d22d23 (patch)
tree7a2aea7553433957be0455694a7b39e91668dd42 /src/web/js/components/Menu.react.js
parentcommit the session after deleting old articles. (diff)
parentFixed merge conflicts. (diff)
downloadnewspipe-181ee8dced7cccc687136c6f35faf2bff1d22d23.tar.gz
newspipe-181ee8dced7cccc687136c6f35faf2bff1d22d23.tar.bz2
newspipe-181ee8dced7cccc687136c6f35faf2bff1d22d23.zip
Fixed merge conflicts.
Diffstat (limited to 'src/web/js/components/Menu.react.js')
-rw-r--r--src/web/js/components/Menu.react.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/web/js/components/Menu.react.js b/src/web/js/components/Menu.react.js
index 60578f8a..4537ee81 100644
--- a/src/web/js/components/Menu.react.js
+++ b/src/web/js/components/Menu.react.js
@@ -84,13 +84,15 @@ var CategoryGroup = React.createClass({
name: React.PropTypes.string.isRequired,
feeds: React.PropTypes.array.isRequired,
unread: React.PropTypes.number.isRequired,
- folded: React.PropTypes.bool.isRequired,
+ folded: React.PropTypes.bool,
},
getInitialState: function() {
- return {folded: this.props.folded};
+ return {folded: false};
},
componentWillReceiveProps: function(nextProps) {
- this.setState({folded: nextProps.folded});
+ if(nextProps.folded != null) {
+ this.setState({folded: nextProps.folded});
+ }
},
render: function() {
// hidden the no category if empty
@@ -265,7 +267,22 @@ var Menu = React.createClass({
);
},
componentDidMount: function() {
- MenuActions.reload();
+ var setFilterFunc = null;
+ var id = null;
+ if(window.location.search.substring(1)) {
+ var args = window.location.search.substring(1).split('&');
+ args.map(function(arg) {
+ if (arg.split('=')[0] == 'at' && arg.split('=')[1] == 'c') {
+ setFilterFunc = MiddlePanelActions.setCategoryFilter;
+ } else if (arg.split('=')[0] == 'at' && arg.split('=')[1] == 'f') {
+ setFilterFunc = MiddlePanelActions.setFeedFilter;
+
+ } else if (arg.split('=')[0] == 'ai') {
+ id = parseInt(arg.split('=')[1]);
+ }
+ });
+ }
+ MenuActions.reload(setFilterFunc, id);
MenuStore.addChangeListener(this._onChange);
},
componentWillUnmount: function() {
bgstack15