Do not crash if some apis are only for admins

This commit is contained in:
Johannes Zellner
2019-05-14 16:41:08 +02:00
parent 84473dc10d
commit 2039a143ac
2 changed files with 6 additions and 0 deletions

View File

@@ -83,6 +83,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
// NOTE: this function is exported and called from the settings.js
$scope.updateSubscriptionStatus = function () {
if (!Client.getUserInfo().admin) return;
Client.getSubscription(function (error, subscription) {
if (error && error.statusCode === 412) return; // ignore if not yet registered
if (error) console.error(error);