From 9a64dc27fc9fd7d7838fae7e9ec677c1fa2a0182 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 29 Nov 2015 13:32:13 +0000 Subject: [PATCH] improve layout for search results, fix syntax highlighting quirks in sublime, and don't crash on zero results --- src/controllers/organisms/RoomView.js | 5 ++++- src/skins/vector/views/organisms/RoomView.js | 21 +++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index f33b5ee9..40564e55 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -502,7 +502,10 @@ module.exports = { var EventTile = sdk.getComponent('messages.Event'); var self = this; - if (this.state.searchResults) { + if (this.state.searchResults && + this.state.searchResults.search_categories.room_events.results && + this.state.searchResults.search_categories.room_events.groups) + { // XXX: this dance is foul, due to the results API not directly returning sorted results var results = this.state.searchResults.search_categories.room_events.results; var roomIdGroups = this.state.searchResults.search_categories.room_events.groups.room_id; diff --git a/src/skins/vector/views/organisms/RoomView.js b/src/skins/vector/views/organisms/RoomView.js index 9a703beb..a34d321e 100644 --- a/src/skins/vector/views/organisms/RoomView.js +++ b/src/skins/vector/views/organisms/RoomView.js @@ -206,7 +206,7 @@ module.exports = React.createClass({ if (this.state.syncState === "ERROR") { statusBar = (
- /!\ + /!\
Connectivity to the server has been lost. @@ -221,7 +221,7 @@ module.exports = React.createClass({ else if (this.state.hasUnsentMessages) { statusBar = (
- /!\ + /!\
Some of your messages have not been sent. @@ -291,16 +291,8 @@ module.exports = React.createClass({
; } - var statusArea, messageComposer; + var messageComposer; if (!this.state.searchResults) { - statusArea = -
-
-
- {statusBar} -
-
- messageComposer = } @@ -324,7 +316,12 @@ module.exports = React.createClass({
- { statusArea } +
+
+
+ { this.state.searchResults ? null : statusBar } +
+
{ messageComposer }
);