Do not show error and empty appstore details if not yet setup

This commit is contained in:
Johannes Zellner
2019-05-06 11:39:45 +02:00
parent 83e2bd6ade
commit 59a54f8683
2 changed files with 54 additions and 34 deletions

View File

@@ -12,6 +12,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.installedApps = Client.getInstalledApps();
$scope.subscription = null;
$scope.subscriptionBusy = true;
$scope.prettyProviderName = function (provider) {
switch (provider) {
@@ -307,7 +308,12 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
}
function getSubscription() {
$scope.subscriptionBusy = true;
Client.getSubscription(function (error, result) {
$scope.subscriptionBusy = false;
if (error && error.statusCode === 412) return; // not yet registered
if (error) return console.error(error);
if (!$scope.$parent) return; // user changed view. otherwise we get an error that $scope.$parent is null