#SetTimeout not working as expected

1 messages · Page 1 of 1 (latest)

toxic yarrow
#

{{
( async function( )
{
const response = await Loan_Disbursal_Bulk.run()

await closeModal('bulk_loan_confirm')

await showModal('waitscreen')

setTimeout(() => { closeModal('waitscreen') }, 2000)

await storeValue("status_2",response.status)

await storeValue("message_2",response.message)

}

)
( )

}}

In this code i want to close the modal named "waitscreen" after 2 sec, but its not closing..Is there any other solution for this.

zenith capeBOT
#

Hey There,

We've registered your query, and our team will get back to you soon.

Regards,
Pranav

#

Hello! What is your Appsmith version? Do you get any errors when running the
function? Could you please share a loom.com screen recording to show the issue
in action?

toxic yarrow
#

Hi, i have solved the issue by including the following lines.
await new Promise(resolve => setTimeout(resolve, 5000))