From 345cfd6f3689b6da4c3ea7145a09f45c1147a7bc Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 20 May 2021 15:00:46 +0100 Subject: [PATCH] Fixed error when changing subscription access back to saved setting no issue - if you switch back to the saved subscription access setting we attempted to use destructuring assignment from an `undefined` value - switched to using direct assignment and optional chaining --- ghost/admin/app/controllers/settings/membership.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/admin/app/controllers/settings/membership.js b/ghost/admin/app/controllers/settings/membership.js index b0d15b0c95..0da6ada778 100644 --- a/ghost/admin/app/controllers/settings/membership.js +++ b/ghost/admin/app/controllers/settings/membership.js @@ -104,7 +104,7 @@ export default class MembersAccessController extends Controller { @action async membersSubscriptionAccessChanged() { - const [oldValue] = this.settings.changedAttributes().membersSignupAccess; + const oldValue = this.settings.changedAttributes().membersSignupAccess?.[0]; if (oldValue === 'none') { // when saved value is 'none' the server won't inject the portal script