From d1e1dc3e794edfd8f0a338078f437a659103883b Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Mon, 17 Jul 2023 12:45:16 +0200 Subject: [PATCH] Fixed memberlinks returning undefined in autocomplete. (#17385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Ghost/pull/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. --- ### 🤖 Generated by Copilot at 59d45a1 Improved `memberLinks` function in `koenig-lexical-editor.js` to support optional links and fix a bug. --- ghost/admin/app/components/koenig-lexical-editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/koenig-lexical-editor.js b/ghost/admin/app/components/koenig-lexical-editor.js index f4df027de2..7963ad19b0 100644 --- a/ghost/admin/app/components/koenig-lexical-editor.js +++ b/ghost/admin/app/components/koenig-lexical-editor.js @@ -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') @@ -275,6 +276,8 @@ export default class KoenigLexicalEditor extends Component { value: this.config.getSiteUrl('/#/portal/account/plans') }]; } + + return links; }; return [...defaults, ...offersLinks, ...memberLinks()]; };