Alert freezes Figma plugin

In my Figma plugin, there is a javascript alert shown. When Ok button of the alert box is clicked, the plugin became unresponsive for few seconds. One more observation noticed is, when we navigate immediately to some other tab in the PC and come back to the Figma, then it is immediately rectified.