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.

  • @perchanceM
    link
    English
    2
    edit-2
    4 months ago

    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 the onFinishPromise, while staying backwards-compatible by overwriting the toString of the promise to return the normal iframe HTML. The problem was that I forgot to add onFinishPromise 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 of let result = await aiText(promptOptions).onFinishPromise with that plugin too.

    Maybe for backwards compatibility there could be a property called that pointing to the same promise?

    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!

    • @wthit56OP
      link
      English
      24 months ago

      Ah cool. No problem 👍