Skip to content

Commit

Permalink
Remove AuthorizationManager.pendingServicesArray in favor of set
Browse files Browse the repository at this point in the history
  • Loading branch information
tejaede committed Nov 20, 2018
1 parent 1782656 commit 1a70540
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions data/service/authorization-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ exports.AuthorizationManager = Montage.specialize(/** @lends AuthorizationManage
this._panelsByModuleID = new Map();
this._authorizationsByProviderModuleID = new Map();
this._pendingServices = new Set();
this._pendingServicesArray = [];
this.defineBinding("hasPendingServices", {"<-": "_pendingServicesArray.length > 0"});
this.defineBinding("hasPendingServices", {"<-": "_pendingServices.size > 0"});
return this;
}
},
Expand Down Expand Up @@ -190,7 +189,6 @@ exports.AuthorizationManager = Montage.specialize(/** @lends AuthorizationManage
result = null;

self._pendingServices.add(provider.identifier);
self._pendingServicesArray.push(provider.identifier);
return this._managerPanel().then(function (authManagerPanel) {
managerPanel = authManagerPanel;
return self._panelForProvider(provider);
Expand All @@ -201,8 +199,6 @@ exports.AuthorizationManager = Montage.specialize(/** @lends AuthorizationManage
return authorization;
}).finally(function () {
self._pendingServices.delete(provider.identifier);
var index = self._pendingServicesArray.indexOf(provider.identifier);
self._pendingServicesArray.splice(index, 1);
return result;
});
}
Expand Down Expand Up @@ -355,10 +351,6 @@ exports.AuthorizationManager = Montage.specialize(/** @lends AuthorizationManage
value: undefined
},

_pendingServicesArray: {
value: undefined
},

delegate: {
value: null
},
Expand Down

0 comments on commit 1a70540

Please sign in to comment.