select_message: Fall back to the last, not first, message

This seems more likely to be what people want when e.g. viewing all huddles.
Later we can get more clever and select the nearest huddle, or something.

(imported from commit 8ec1aa02c050dd25eb868b1e317d114743525c7b)
This commit is contained in:
Keegan McAllister 2012-10-23 16:19:28 -04:00
parent 37ac9d2a91
commit e7746e97e8
1 changed files with 2 additions and 2 deletions

View File

@ -240,9 +240,9 @@ function select_message(next_message, opts) {
next_message = rows.next_visible(next_message); next_message = rows.next_visible(next_message);
} }
/* Fall back to the first visible message. */ /* Fall back to the last visible message. */
if (next_message.length === 0) { if (next_message.length === 0) {
next_message = rows.first_visible(); next_message = rows.last_visible();
if (next_message.length === 0) { if (next_message.length === 0) {
// There are no messages! // There are no messages!
return false; return false;