Skip to content

Commit

Permalink
Fixed memberlinks returning undefined in autocomplete. (#17385)
Browse files Browse the repository at this point in the history
refs #17327

- Added an additional condition to avoid the new memberLinks function
from returning undefined, which may lead to nothing being returned at
all in the autocomplete.

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 59d45a1</samp>

Improved `memberLinks` function in `koenig-lexical-editor.js` to support
optional links and fix a bug.
  • Loading branch information
ronaldlangeveld authored Jul 17, 2023
1 parent ea2defb commit d1e1dc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ghost/admin/app/components/koenig-lexical-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ export default class KoenigLexicalEditor extends Component {
});

const memberLinks = () => {
let links = [];
if (this.membersUtils.paidMembersEnabled) {
return [
links = [
{
label: 'Paid signup',
value: this.config.getSiteUrl('/#/portal/signup')
Expand All @@ -275,6 +276,8 @@ export default class KoenigLexicalEditor extends Component {
value: this.config.getSiteUrl('/#/portal/account/plans')
}];
}

return links;
};
return [...defaults, ...offersLinks, ...memberLinks()];
};
Expand Down

0 comments on commit d1e1dc3

Please sign in to comment.