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
This commit is contained in:
Kevin Ansfield 2021-05-20 15:00:46 +01:00
parent dee5129edf
commit 345cfd6f36

View File

@ -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