mirror of https://github.com/zulip/zulip.git
Get next local id correctly when all message list is empty
(imported from commit 07208222ea682251927ef13c684e9e89277233bf)
This commit is contained in:
parent
01e948ac97
commit
2fac412119
|
@ -115,7 +115,7 @@ exports._add_message_flags = add_message_flags;
|
||||||
function get_next_local_id() {
|
function get_next_local_id() {
|
||||||
var local_id_increment = 0.01;
|
var local_id_increment = 0.01;
|
||||||
var latest = page_params.max_message_id;
|
var latest = page_params.max_message_id;
|
||||||
if (typeof all_msg_list !== 'undefined') {
|
if (typeof all_msg_list !== 'undefined' && all_msg_list.last() !== undefined) {
|
||||||
latest = all_msg_list.last().id;
|
latest = all_msg_list.last().id;
|
||||||
}
|
}
|
||||||
return truncate_precision(latest + local_id_increment);
|
return truncate_precision(latest + local_id_increment);
|
||||||
|
|
Loading…
Reference in New Issue