Skip to content

Commit 7d15c61

Browse files
KenChoiKenChoi
authored andcommitted
set default value of isDescend to false
1 parent 861f8e5 commit 7d15c61

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

android/src/io/jchat/android/JMessageModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,15 @@ public void getHistoryMessages(ReadableMap map, Callback success, Callback fail)
509509
int from = map.getInt(Constant.FROM);
510510
int limit = map.getInt(Constant.LIMIT);
511511
List<Message> messages = conversation.getMessagesFromNewest(from, limit);
512-
// Is descend 为 false 则按照时间顺序排列,2.3.5 新增字段
512+
// Is descend 为 false,即默认按照时间顺序排列,2.3.5 新增字段
513+
boolean isDescend = false;
513514
if (map.hasKey(Constant.IS_DESCEND)) {
514-
boolean isDescend = map.getBoolean(Constant.IS_DESCEND);
515-
if (!isDescend) {
516-
Collections.reverse(messages);
517-
}
515+
isDescend = map.getBoolean(Constant.IS_DESCEND);
516+
}
517+
if (!isDescend) {
518+
Collections.reverse(messages);
518519
}
519520
success.invoke(ResultUtils.toJSArray(messages));
520-
521521
} catch (Exception e) {
522522
e.printStackTrace();
523523
mJMessageUtils.handleError(fail, ERR_CODE_PARAMETER, "Unexpected error");

0 commit comments

Comments
 (0)