@osovitny/anatoly 3.20.2 → 3.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -615,9 +615,9 @@ function BuyAccessButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
615
615
|
} if (rf & 2) {
|
|
616
616
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
617
617
|
i0.ɵɵadvance();
|
|
618
|
-
i0.ɵɵproperty("ngIf", ctx_r1.plan == ctx_r1.
|
|
618
|
+
i0.ɵɵproperty("ngIf", ctx_r1.plan == ctx_r1.currentPlanId);
|
|
619
619
|
i0.ɵɵadvance();
|
|
620
|
-
i0.ɵɵproperty("ngIf", ctx_r1.plan != ctx_r1.
|
|
620
|
+
i0.ɵɵproperty("ngIf", ctx_r1.plan != ctx_r1.currentPlanId);
|
|
621
621
|
} }
|
|
622
622
|
function BuyAccessButtonComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
623
623
|
i0.ɵɵelementStart(0, "div");
|
|
@@ -633,7 +633,7 @@ class BuyAccessButtonComponent {
|
|
|
633
633
|
this.appContext = appContext;
|
|
634
634
|
this.contextUpdated = false;
|
|
635
635
|
this.isUserSignedIn = false;
|
|
636
|
-
this.
|
|
636
|
+
this.currentPlanId = -1;
|
|
637
637
|
this.visibleIfUserSignedIn = false;
|
|
638
638
|
//Outputs
|
|
639
639
|
this.planselect = new EventEmitter();
|
|
@@ -651,8 +651,8 @@ class BuyAccessButtonComponent {
|
|
|
651
651
|
}
|
|
652
652
|
this.isUserSignedIn = context.isUserSignedIn;
|
|
653
653
|
if (this.isUserSignedIn) {
|
|
654
|
-
let
|
|
655
|
-
this.
|
|
654
|
+
let profile = context.billing.profile;
|
|
655
|
+
this.currentPlanId = profile.planId;
|
|
656
656
|
}
|
|
657
657
|
this.contextUpdated = true;
|
|
658
658
|
});
|
|
@@ -670,7 +670,7 @@ class BuyAccessButtonComponent {
|
|
|
670
670
|
}
|
|
671
671
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BuyAccessButtonComponent, [{
|
|
672
672
|
type: Component,
|
|
673
|
-
args: [{ selector: 'anatoly-billing-buyaccess-button', standalone: false, template: "<div *ngIf=\"contextUpdated\">\r\n <!--\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classes=\"btn btn-block btn-primary\" />\r\n </div>\r\n -->\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan ==
|
|
673
|
+
args: [{ selector: 'anatoly-billing-buyaccess-button', standalone: false, template: "<div *ngIf=\"contextUpdated\">\r\n <!--\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classes=\"btn btn-block btn-primary\" />\r\n </div>\r\n -->\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlanId\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlanId\"\r\n (click)=\"onPlanSelect()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
|
|
674
674
|
}], () => [{ type: AppContextService }], { plan: [{
|
|
675
675
|
type: Input
|
|
676
676
|
}], visibleIfUserSignedIn: [{
|
|
@@ -759,9 +759,9 @@ class SubscribePlanButtonComponent {
|
|
|
759
759
|
}
|
|
760
760
|
this.isUserSignedIn = context.isUserSignedIn;
|
|
761
761
|
if (this.isUserSignedIn) {
|
|
762
|
-
let
|
|
763
|
-
this.currentPlanId =
|
|
764
|
-
this.requestedPlanId =
|
|
762
|
+
let profile = context.billing.profile;
|
|
763
|
+
this.currentPlanId = profile.planId;
|
|
764
|
+
this.requestedPlanId = profile.requestedPlanId ?? -1;
|
|
765
765
|
}
|
|
766
766
|
this.contextUpdated = true;
|
|
767
767
|
});
|