From c816b15bfa3c9e2d5c3fd1edfb05a84b9fe96d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 13 Jun 2018 18:57:59 +0200 Subject: [PATCH] Fix race condition when loading the user list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/service/BoardService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/service/BoardService.js b/js/service/BoardService.js index ba66a69fe..b7cad27e2 100644 --- a/js/service/BoardService.js +++ b/js/service/BoardService.js @@ -198,13 +198,13 @@ app.factory('BoardService', function (ApiService, $http, $q) { return []; } - var result = [this.getCurrent().owner]; + this.getCurrent().users = [this.getCurrent().owner]; + let self = this; angular.forEach(this.getCurrent().acl, function(value, key) { if (value.type === OC.Share.SHARE_TYPE_USER) { - result.push(value.participant); + self.getCurrent().users.push(value.participant); } }); - this.getCurrent().users = result; }; BoardService.prototype.getUsers = function () {