mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed portal preview not updating when changing from a saved "Nobody" access
no issue When members signup access is saved as "none" the front-end won't inject the portal script when rendering meaning changing to "all" or "invite" in Admin will show the preview but there's no portal script injected for the portal to show up. - detect when we're switching from a saved "none" state and force a save and full refresh of the iframe
This commit is contained in:
parent
03844d5b97
commit
dee5129edf
2 changed files with 17 additions and 1 deletions
|
@ -102,6 +102,22 @@ export default class MembersAccessController extends Controller {
|
||||||
this.leaveSettingsTransition = null;
|
this.leaveSettingsTransition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
async membersSubscriptionAccessChanged() {
|
||||||
|
const [oldValue] = this.settings.changedAttributes().membersSignupAccess;
|
||||||
|
|
||||||
|
if (oldValue === 'none') {
|
||||||
|
// when saved value is 'none' the server won't inject the portal script
|
||||||
|
// to work around that and show the expected portal preview we save and
|
||||||
|
// force a refresh
|
||||||
|
await this.saveSettingsTask.perform();
|
||||||
|
this.updatePortalPreview();
|
||||||
|
this.portalPreviewGuid = Date.now().valueOf();
|
||||||
|
} else {
|
||||||
|
this.updatePortalPreview();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
setStripePlansCurrency(event) {
|
setStripePlansCurrency(event) {
|
||||||
const newCurrency = event.value;
|
const newCurrency = event.value;
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="gh-setting-members-access">
|
<div class="gh-setting-members-access">
|
||||||
<Settings::MembersSubscriptionAccess @onChange={{this.updatePortalPreview}} />
|
<Settings::MembersSubscriptionAccess @onChange={{this.membersSubscriptionAccessChanged}} />
|
||||||
<Settings::MembersDefaultPostAccess />
|
<Settings::MembersDefaultPostAccess />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue