diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2017-06-12 18:36:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-12 18:36:16 +0300 |
commit | bc50c682d0ef8c11c166ccaff73a0976eb4eb9de (patch) | |
tree | 776a231046e328a118fc5fe0868c33395b4e9f52 | |
parent | 4b1339acf7b54f1df333fb8d5ee59eeb30cbe9ae (diff) | |
parent | ecb933ddac8837c0011f3462ab105098eead0491 (diff) |
Merge pull request #390 from nextcloud/fix/add-new-accountnightly-20170612
Fix adding a new account
-rw-r--r-- | js/service/accountservice.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/js/service/accountservice.js b/js/service/accountservice.js index 9bc9c33ff..c7b09250e 100644 --- a/js/service/accountservice.js +++ b/js/service/accountservice.js @@ -64,7 +64,17 @@ define(function(require) { return Promise.resolve(accounts); } - return Promise.resolve(accounts.fetch()); + return new Promise(function(resolve, reject) { + accounts.fetch({ + success: function() { + // fetch resolves the Promise with the raw data returned by + // the ajax call. Since we want the Backbone models, we have + // to 'convert' the response here. + resolve(accounts); + }, + error: reject + }); + }); } function getAccountEntities() { |