Skip to content

Commit 54df6c2

Browse files
michaelklishinmergify-bot
authored andcommitted
Use a for loop here because IE 11 does not support lambdas
Closes #3688 (cherry picked from commit 8e180c5) (cherry picked from commit 7f14c76)
1 parent d34c4a9 commit 54df6c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

deps/rabbitmq_management/priv/www/js/dispatcher.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,13 @@ dispatcher_add(function(sammy) {
179179
sammy.get('#/users/:id', function() {
180180
var vhosts = JSON.parse(sync_get('/vhosts'));
181181
const current_vhost = get_pref('vhost');
182-
let index_vhost = vhosts.findIndex(v => v.name === current_vhost);
183-
index_vhost = index_vhost === -1 ? 0 : index_vhost;
182+
var index_vhost = 0;
183+
for (var i = 0; i < vhosts.length; i++) {
184+
if (vhosts[i].name === current_vhost) {
185+
index_vhost = i;
186+
break;
187+
}
188+
}
184189
render({'user': '/users/' + esc(this.params['id']),
185190
'permissions': '/users/' + esc(this.params['id']) + '/permissions',
186191
'topic_permissions': '/users/' + esc(this.params['id']) + '/topic-permissions',

0 commit comments

Comments
 (0)