mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Iterate through an array without using 'in', remove extra spacing.
This corrects some additional bugs introduced in 9128ddd and a5f06bd identified by Keegan. We previously used "for i in"-style looping, which is sub-optimal. Move to a different style. We also had a weird spacing thing I introduced in a previous commit, which has now been fixed. (imported from commit 7334d8ee703564bedeb0ea939b0d64ad2d5fceba)
This commit is contained in:
@@ -228,7 +228,7 @@ function respond_to_zephyr() {
|
|||||||
} else if (zephyr.type === 'huddle') {
|
} else if (zephyr.type === 'huddle') {
|
||||||
$('#zephyr-type-tabs a[href="#personal-message"]').tab('show');
|
$('#zephyr-type-tabs a[href="#personal-message"]').tab('show');
|
||||||
recipient = '';
|
recipient = '';
|
||||||
for (i in zephyr.display_recipient) {
|
for (var i = 0; i < zephyr.display_recipient.length; i++) {
|
||||||
recipient += zephyr.display_recipient[i].name + ', ';
|
recipient += zephyr.display_recipient[i].name + ', ';
|
||||||
}
|
}
|
||||||
prepare_huddle(recipient);
|
prepare_huddle(recipient);
|
||||||
@@ -237,7 +237,7 @@ function respond_to_zephyr() {
|
|||||||
// representations of a user (name, username, email, etc.), just
|
// representations of a user (name, username, email, etc.), just
|
||||||
// deal with usernames.
|
// deal with usernames.
|
||||||
recipient = zephyr.display_recipient;
|
recipient = zephyr.display_recipient;
|
||||||
if ( recipient === username) { // that is, we sent the original message
|
if (recipient === username) { // that is, we sent the original message
|
||||||
recipient = zephyr.sender;
|
recipient = zephyr.sender;
|
||||||
}
|
}
|
||||||
prepare_huddle(recipient);
|
prepare_huddle(recipient);
|
||||||
|
|||||||
Reference in New Issue
Block a user