From dedaf0f5a2288705673a6cf70dd577519f37d8f3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 12:36:54 +0100 Subject: [PATCH 1/5] disable lazy list rendering if extraTiles are provided --- src/components/structures/RoomSubList.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index f7f74da728..d72f84b47f 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -282,7 +282,7 @@ const RoomSubList = React.createClass({ this.setState({scrollTop: this.refs.scroller.getScrollTop()}); }, - _getRenderItems: function() { + _getList: function() { // try our best to not create a new array // because LazyRenderList rerender when the items prop // is not the same object as the previous value @@ -296,6 +296,12 @@ const RoomSubList = React.createClass({ return list.concat(extraTiles); }, + _canUseLazyListRendering() { + // for now disable lazy rendering as they are already rendered tiles + // not rooms like props.list we pass to LazyRenderList + return !this.props.extraTiles || !this.props.extraTiles.length; + }, + render: function() { const len = this.props.list.length + this.props.extraTiles.length; const isCollapsed = this.state.hidden && !this.props.forceExpand; @@ -310,7 +316,7 @@ const RoomSubList = React.createClass({ return
{this._getHeaderJsx(isCollapsed)}
; - } else { + } else if (this._canUseLazyListRendering()) { return
{this._getHeaderJsx(isCollapsed)} @@ -319,7 +325,16 @@ const RoomSubList = React.createClass({ height={ this.state.scrollerHeight } renderItem={ this.makeRoomTile } itemHeight={34} - items={this._getRenderItems()} /> + items={ this.props.list } /> + +
; + } else { + const roomTiles = this.props.list.map(r => this.makeRoomTile(r)); + const tiles = roomTiles.concat(this.props.extraTiles); + return
+ {this._getHeaderJsx(isCollapsed)} + + { tiles }
; } From c39c0e48344aea9b9776e2c6578c197b768c5ea0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 12:37:22 +0100 Subject: [PATCH 2/5] fix for the ... button not being aligned for group invite tiles --- res/css/views/rooms/_RoomTile.scss | 4 ++++ src/components/views/groups/GroupInviteTile.js | 1 + 2 files changed, 5 insertions(+) diff --git a/res/css/views/rooms/_RoomTile.scss b/res/css/views/rooms/_RoomTile.scss index 6b2e2573e5..f2557f7849 100644 --- a/res/css/views/rooms/_RoomTile.scss +++ b/res/css/views/rooms/_RoomTile.scss @@ -191,3 +191,7 @@ limitations under the License. .mx_RoomTile.mx_RoomTile_transparent:focus { background-color: $roomtile-transparent-focused-color; } + +.mx_GroupInviteTile .mx_RoomTile_name { + flex: 1; +} diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 9e28ff5adf..44441f4754 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -150,6 +150,7 @@ export default React.createClass({ const classes = classNames('mx_RoomTile mx_RoomTile_highlight', { 'mx_RoomTile_menuDisplayed': this.state.menuDisplayed, 'mx_RoomTile_selected': this.state.selected, + 'mx_GroupInviteTile': true, }); return ( From 05ddee6a6be247096e173c4f8bcb6b682860b46c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 12:56:11 +0100 Subject: [PATCH 3/5] remove dead code --- src/components/structures/RoomSubList.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index d72f84b47f..78cc5bd58f 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -282,20 +282,6 @@ const RoomSubList = React.createClass({ this.setState({scrollTop: this.refs.scroller.getScrollTop()}); }, - _getList: function() { - // try our best to not create a new array - // because LazyRenderList rerender when the items prop - // is not the same object as the previous value - const {list, extraTiles} = this.props; - if (!extraTiles || !extraTiles.length) { - return list; - } - if (!list || list.length) { - return extraTiles; - } - return list.concat(extraTiles); - }, - _canUseLazyListRendering() { // for now disable lazy rendering as they are already rendered tiles // not rooms like props.list we pass to LazyRenderList From 5e3c598d315ab3a4ba3a1e1d1361a9f33b70de4d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 13:52:48 +0100 Subject: [PATCH 4/5] Prepare changelog for v1.0.1 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d52105f9f9..6e2d021254 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [1.0.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v1.0.1) (2019-02-15) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v1.0.0...v1.0.1) + + * Fix community invites crashing the app + [\#2650](https://github.com/matrix-org/matrix-react-sdk/pull/2650) + Changes in [1.0.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v1.0.0) (2019-02-14) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v1.0.0-rc.2...v1.0.0) From c8fa30d8eee722a2b68ce0008d7e8a73e540ef35 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 13:52:48 +0100 Subject: [PATCH 5/5] v1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b7646dda7..fba17bb9c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "1.0.0", + "version": "1.0.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {