appstore: remove unused getCloudronDetails
This commit is contained in:
@@ -152,17 +152,6 @@ angular.module('Application').service('AppStore', ['$http', '$base64', 'Client',
|
||||
});
|
||||
};
|
||||
|
||||
AppStore.prototype.getCloudronDetails = function (appstoreConfig, callback) {
|
||||
if (Client.getConfig().apiServerOrigin === null) return callback(new AppStoreError(420, 'Enhance Your Calm'));
|
||||
|
||||
$http.get(Client.getConfig().apiServerOrigin + '/api/v1/users/' + appstoreConfig.userId + '/cloudrons/' + appstoreConfig.cloudronId, { params: { accessToken: appstoreConfig.token }}).success(function (data, status) {
|
||||
if (status !== 200) return callback(new AppStoreError(status, data));
|
||||
return callback(null, data.cloudron);
|
||||
}).error(function (data, status) {
|
||||
return callback(new AppStoreError(status, data));
|
||||
});
|
||||
};
|
||||
|
||||
AppStore.prototype.getSubscription = function (appstoreConfig, callback) {
|
||||
if (Client.getConfig().apiServerOrigin === null) return callback(new AppStoreError(420, 'Enhance Your Calm'));
|
||||
|
||||
|
||||
+15
-19
@@ -497,30 +497,26 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
|
||||
var appstoreConfig = result;
|
||||
|
||||
AppStore.getCloudronDetails(appstoreConfig, function (error) {
|
||||
if (error) return callback(error);
|
||||
AppStore.getProfile(appstoreConfig.token, function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
AppStore.getProfile(appstoreConfig.token, function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
// assign late to avoid UI flicketing on update
|
||||
appstoreConfig.profile = result;
|
||||
$scope.appstoreConfig = appstoreConfig;
|
||||
|
||||
// assign late to avoid UI flicketing on update
|
||||
appstoreConfig.profile = result;
|
||||
$scope.appstoreConfig = appstoreConfig;
|
||||
$scope.validAppstoreAccount = true;
|
||||
|
||||
$scope.validAppstoreAccount = true;
|
||||
// clear busy state when a login/signup was performed
|
||||
$scope.appstoreLogin.busy = false;
|
||||
|
||||
// clear busy state when a login/signup was performed
|
||||
$scope.appstoreLogin.busy = false;
|
||||
// also update the root controller status
|
||||
if ($scope.$parent) {
|
||||
$scope.$parent.fetchAppstoreProfileAndSubscription(function (error) {
|
||||
if (error) console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
// also update the root controller status
|
||||
if ($scope.$parent) {
|
||||
$scope.$parent.fetchAppstoreProfileAndSubscription(function (error) {
|
||||
if (error) console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user