mirror of https://github.com/zulip/zulip.git
Optimize select_zephyr_by_id for the already-selected case
Saves a call to get_zephyr. (imported from commit 9ce9f2af7e4d8eb5e3a76a3c0ddbfb7f5896a583)
This commit is contained in:
parent
a00227c864
commit
d4985ef5f4
|
@ -306,6 +306,9 @@ function respond_to_zephyr() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_zephyr_by_id(zephyr_id, scroll_to) {
|
function select_zephyr_by_id(zephyr_id, scroll_to) {
|
||||||
|
if (zephyr_id === selected_zephyr_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
select_zephyr(get_zephyr(zephyr_id), scroll_to);
|
select_zephyr(get_zephyr(zephyr_id), scroll_to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue