Skip to content

Commit 9a64dc2

Browse files
committed
improve layout for search results, fix syntax highlighting quirks in sublime, and don't crash on zero results
1 parent af6bd53 commit 9a64dc2

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/controllers/organisms/RoomView.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,10 @@ module.exports = {
502502
var EventTile = sdk.getComponent('messages.Event');
503503
var self = this;
504504

505-
if (this.state.searchResults) {
505+
if (this.state.searchResults &&
506+
this.state.searchResults.search_categories.room_events.results &&
507+
this.state.searchResults.search_categories.room_events.groups)
508+
{
506509
// XXX: this dance is foul, due to the results API not directly returning sorted results
507510
var results = this.state.searchResults.search_categories.room_events.results;
508511
var roomIdGroups = this.state.searchResults.search_categories.room_events.groups.room_id;

src/skins/vector/views/organisms/RoomView.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ module.exports = React.createClass({
206206
if (this.state.syncState === "ERROR") {
207207
statusBar = (
208208
<div className="mx_RoomView_connectionLostBar">
209-
<img src="img/warning2.png" width="30" height="30" alt="/!\"/>
209+
<img src="img/warning2.png" width="30" height="30" alt="/!\ "/>
210210
<div className="mx_RoomView_connectionLostBar_textArea">
211211
<div className="mx_RoomView_connectionLostBar_title">
212212
Connectivity to the server has been lost.
@@ -221,7 +221,7 @@ module.exports = React.createClass({
221221
else if (this.state.hasUnsentMessages) {
222222
statusBar = (
223223
<div className="mx_RoomView_connectionLostBar">
224-
<img src="img/warning2.png" width="30" height="30" alt="/!\"/>
224+
<img src="img/warning2.png" width="30" height="30" alt="/!\ "/>
225225
<div className="mx_RoomView_connectionLostBar_textArea">
226226
<div className="mx_RoomView_connectionLostBar_title">
227227
Some of your messages have not been sent.
@@ -291,16 +291,8 @@ module.exports = React.createClass({
291291
</div>;
292292
}
293293

294-
var statusArea, messageComposer;
294+
var messageComposer;
295295
if (!this.state.searchResults) {
296-
statusArea =
297-
<div className="mx_RoomView_statusArea">
298-
<div className="mx_RoomView_statusAreaBox">
299-
<div className="mx_RoomView_statusAreaBox_line"></div>
300-
{statusBar}
301-
</div>
302-
</div>
303-
304296
messageComposer =
305297
<MessageComposer room={this.state.room} roomView={this} uploadFile={this.uploadFile} />
306298
}
@@ -324,7 +316,12 @@ module.exports = React.createClass({
324316
</ol>
325317
</div>
326318
</GeminiScrollbar>
327-
{ statusArea }
319+
<div className="mx_RoomView_statusArea">
320+
<div className="mx_RoomView_statusAreaBox">
321+
<div className="mx_RoomView_statusAreaBox_line"></div>
322+
{ this.state.searchResults ? null : statusBar }
323+
</div>
324+
</div>
328325
{ messageComposer }
329326
</div>
330327
);

0 commit comments

Comments
 (0)