From 23a4ad09de27f4515d29314021fb0ea8ce1abc37 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 24 Feb 2017 02:30:27 -0500 Subject: [PATCH 1/5] Fix "Component not mounted" error in FileActions --- js/component/file-actions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/component/file-actions.js b/js/component/file-actions.js index 0eab19dea..583d094d1 100644 --- a/js/component/file-actions.js +++ b/js/component/file-actions.js @@ -252,9 +252,11 @@ export let FileActions = React.createClass({ }); }, onFileInfoUpdate: function(fileInfo) { - this.setState({ - fileInfo: fileInfo, - }); + if (this.isMounted) { + this.setState({ + fileInfo: fileInfo, + }); + } }, componentDidMount: function() { this._isMounted = true; From 7172149bac4450e1d18d856ce37d8ccc4f3946ca Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 24 Feb 2017 03:02:32 -0500 Subject: [PATCH 2/5] Tweak padding on drop-down menus --- scss/component/_menu.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scss/component/_menu.scss b/scss/component/_menu.scss index ab871fc2e..e3b0566c4 100644 --- a/scss/component/_menu.scss +++ b/scss/component/_menu.scss @@ -12,14 +12,13 @@ $border-radius-menu: 2px; background-color: white; box-shadow: $default-box-shadow; border-radius: $border-radius-menu; - padding-top: $spacing-vertical / 2; - padding-bottom: $spacing-vertical / 2; + padding-top: ($spacing-vertical / 5) 0px; z-index: 1; } .menu__menu-item { display: block; - padding: $spacing-vertical / 4 $spacing-vertical / 2; + padding: ($spacing-vertical / 4) ($spacing-vertical / 2); &:hover { background: $color-bg-alt; } From e8da1d09f5c9f00f48d2903fd85fd2fb7dde261e Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 24 Feb 2017 03:57:24 -0500 Subject: [PATCH 3/5] Fix some links --- js/page/file-list.js | 2 +- js/page/help.js | 2 +- js/page/show.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/page/file-list.js b/js/page/file-list.js index e16a41ffc..4fc862946 100644 --- a/js/page/file-list.js +++ b/js/page/file-list.js @@ -116,7 +116,7 @@ export let FileListPublished = React.createClass({ else if (!this.state.fileInfos.length) { return (
- You haven't published anything to LBRY yet. Try ! + You haven't published anything to LBRY yet. Try !
); } diff --git a/js/page/help.js b/js/page/help.js index fafec293f..93a550be5 100644 --- a/js/page/help.js +++ b/js/page/help.js @@ -67,7 +67,7 @@ var HelpPage = React.createClass({

Report a Bug

Did you find something wrong?

-

+

Thanks! LBRY is made by its users.
{!ver ? null : diff --git a/js/page/show.js b/js/page/show.js index ae9ea3c33..d469e426d 100644 --- a/js/page/show.js +++ b/js/page/show.js @@ -152,7 +152,7 @@ var DetailPage = React.createClass({ ) : (

No content

- There is no content available at the name lbry://{this.props.name}. If you reached this page from a link within the LBRY interface, please . Thanks! + There is no content available at the name lbry://{this.props.name}. If you reached this page from a link within the LBRY interface, please . Thanks!
)} From b041d66ee430ab2677f341c1e5ceb8cb9de4dfb2 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 24 Feb 2017 04:13:52 -0500 Subject: [PATCH 4/5] Make menus close after you click an option --- js/component/menu.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/component/menu.js b/js/component/menu.js index 2e4321e6d..c35952426 100644 --- a/js/component/menu.js +++ b/js/component/menu.js @@ -42,7 +42,7 @@ export let DropDownMenu = React.createClass({ window.removeEventListener('click', this.handleWindowClick, false); } }, - onMenuIconClick: function(e) { + handleMenuIconClick: function(e) { this.setState({ menuOpen: !this.state.menuOpen, }); @@ -53,6 +53,12 @@ export let DropDownMenu = React.createClass({ } return false; }, + handleMenuClick: function(e) { + // Event bubbles up to the menu after a link is clicked + this.setState({ + menuOpen: false, + }); + }, handleWindowClick: function(e) { if (this.state.menuOpen && (!this._menuDiv || !this._menuDiv.contains(e.target))) { @@ -68,9 +74,9 @@ export let DropDownMenu = React.createClass({ } return (
- this._menuButton = span} button="text" icon="icon-ellipsis-v" onClick={this.onMenuIconClick} /> + this._menuButton = span} button="text" icon="icon-ellipsis-v" onClick={this.handleMenuIconClick} /> {this.state.menuOpen - ?
this._menuDiv = div} className="menu"> + ?
this._menuDiv = div} className="menu" onClick={this.handleMenuClick}> {this.props.children}
: null} From 041771f07b9c7ebc8a1a0296f4ecdf2c80c230b0 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 24 Feb 2017 04:22:44 -0500 Subject: [PATCH 5/5] Publish: restore "you have not published anything yet" message --- js/page/file-list.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/page/file-list.js b/js/page/file-list.js index 4fc862946..9420ff5f0 100644 --- a/js/page/file-list.js +++ b/js/page/file-list.js @@ -75,6 +75,12 @@ export let FileListPublished = React.createClass({ document.title = "Published Files"; lbry.getMyClaims((claimInfos) => { + if (claimInfos.length == 0) { + this.setState({ + fileInfos: [], + }); + } + /** * Build newFileInfos as a sparse array and drop elements in at the same position they * occur in claimInfos, so the order is preserved even if the API calls inside this loop