Add subscription setup link to paid branding feature

This commit is contained in:
Johannes Zellner
2020-06-18 12:16:16 +02:00
parent dbf6520860
commit c8278e7b24
3 changed files with 13 additions and 2 deletions

View File

@@ -2272,6 +2272,9 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
// we only allow the owner to do so
if (!this._userInfo.isAtLeastOwner) return;
// basically the user has not setup appstore account yet
if (!subscription.plan) return window.location.href = '/#/appstore';
var that = this;
var email = subscription.emailEncoded;
@@ -2285,7 +2288,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
var url = that.getConfig().webServerOrigin + '/console.html#/userprofile?view=subscriptions&email=' + email + '&token=' + token;
// Only open the subscription setup dialog when no subscription exists
if (subscription.plan.id === 'free') url += '&cloudronId=' + cloudronId
if (!subscription.plan || subscription.plan.id === 'free') url += '&cloudronId=' + cloudronId
window.location.href = url;
});