From cd7c27d3add9312d59ec6dfdb66fd11e6401690c Mon Sep 17 00:00:00 2001 From: Steve Larson <9larsons@gmail.com> Date: Thu, 22 Aug 2024 08:55:33 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20fetching=20labels=20and?= =?UTF-8?q?=20offers=20in=20the=20editor=20(#20815)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref https://linear.app/tryghost/issue/ONC-263/ - labels dropdown in sign up card was not successfully fetching labels - offers dropdown suffered the same fate When introducing the second editor instance, it appears we ran into some race conditions with the Ember tasks used to fetch the resources. The init instance was beating the other to the punch, and so the state was never successfully updated, as it is only fetched once on mounting the card. --- ghost/admin/app/components/koenig-lexical-editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/koenig-lexical-editor.js b/ghost/admin/app/components/koenig-lexical-editor.js index 8f6f4452c1..ecbc4dfd39 100644 --- a/ghost/admin/app/components/koenig-lexical-editor.js +++ b/ghost/admin/app/components/koenig-lexical-editor.js @@ -248,7 +248,7 @@ export default class KoenigLexicalEditor extends Component { // don't rethrow, Lexical will attempt to gracefully recover } - @task({restartable: true}) + @task({restartable: false}) *fetchOffersTask() { if (this.offers) { return this.offers; @@ -257,7 +257,7 @@ export default class KoenigLexicalEditor extends Component { return this.offers; } - @task({restartable: true}) + @task({restartable: false}) *fetchLabelsTask() { if (this.labels) { return this.labels;