fix: reset inputs when reset conversation (#16233)
This commit is contained in:
parent
106169ed7f
commit
cade0f65e2
2 changed files with 12 additions and 7 deletions
|
|
@ -10,12 +10,14 @@ async function decodeBase64AndDecompress(base64String: string) {
|
|||
return new TextDecoder().decode(decompressedArrayBuffer)
|
||||
}
|
||||
|
||||
function getProcessedInputsFromUrlParams(): Record<string, any> {
|
||||
async function getProcessedInputsFromUrlParams(): Promise<Record<string, any>> {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const inputs: Record<string, any> = {}
|
||||
urlParams.forEach(async (value, key) => {
|
||||
inputs[key] = await decodeBase64AndDecompress(decodeURIComponent(value))
|
||||
})
|
||||
await Promise.all(
|
||||
urlParams.entries().map(async ([key, value]) => {
|
||||
inputs[key] = await decodeBase64AndDecompress(decodeURIComponent(value))
|
||||
}),
|
||||
)
|
||||
return inputs
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue