PirateKitten
PirateKitten3d ago

Rendering extensions differently on "rerender"

Can an extension determine if it is part of the chat history at the time of rendering? I'm looking at the various extensions demos on github, and want to use something like the date picker. Once the user has submitted, the date picker + submit button would be replaced with text showing the date + time they selected. The trouble is if the user refreshes the page / comes back to the conversation later, in the chat history this datetime picker is rendered from the start again using its initial state, like they never filled it in, whereas instead I would want it to look like its final state it reached before where it was just showing the date + time selected.
1 Reply
PirateKitten
PirateKittenOP3d ago
I've managed to come up with a method but it's essentially a workaround / hack - in the render function I get the element and work out if its ancestor "vfrc-system-repsonse--container" element is the latest in its parent, i.e. to work out if it is rendering as part of the last messageo r not. This seems to work but feels very brittle, there would hopefully be a much better method of achieving this.

Did you find this page helpful?