🐛 Fixed fetching labels and offers in the editor (#20815)

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.
This commit is contained in:
Steve Larson 2024-08-22 08:55:33 -05:00 committed by GitHub
parent f984fbd47e
commit cd7c27d3ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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