fix: reset inputs when reset conversation (#16233)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user