Did someone (like literally just this minute) change how generation works, so there is no .onFinishPromise
any more? I’ve fixed my code but that was sudden 😂
Maybe for backwards compatibility there could be a property called that pointing to the same promise?
Ah I see, the returned object is the promise now, and can be used whether the input was a string or an object.
@perchance@lemmy.world
Sorry!! Yes, I just noticed this a couple of minutes ago and fixed it. It was due to a change ~10 minutes ago that now allows for writing
let result = await textToImage(promptOptions);
- i.e. it now returns theonFinishPromise
, while staying backwards-compatible by overwriting thetoString
of the promise to return the normal iframe HTML. The problem was that I forgot to addonFinishPromise
as a property on the returned Promise (i.e. referencing itself) to maintain backwards-compat.Also, side note: I did this for the ai-image-plugin several weeks ago, so you can write also
let result = await aiText(promptOptions)
instead oflet result = await aiText(promptOptions).onFinishPromise
with that plugin too.If there’s ever a backwards-incompatibility, it’s ALWAYS a bug. I cannot stress this enough. I take backwards compatibility really seriously. If I’m ever the cause of your code breaking, that’s my fault, not yours, and it should be reported as a bug.
Thanks for the report!
Ah cool. No problem 👍