Skip to content

Commit c849773

Browse files
Merge pull request #3691 from rabbitmq/mergify/bp/v3.8.x/pr-3690
Use a for loop here because IE 11 does not support lambdas (backport #3689) (backport #3690)
2 parents d34c4a9 + 54df6c2 commit c849773

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)