How to disable plugin functionality while performing external actions

Yes but i must be missing something.

Here I add teh event listener to the button:
$("#btnBrowse").click(function(){browseForFile(this.id);});

Here I call the brows function:

async function browseForFile(id){
  await require("photoshop").core.executeAsModal(async (executionControl, descriptor) => {
    // $('#' + id).prop('disabled', true)
  // document.getElementById(id).disabled = true;
  fullPath = await openBrowsButton();
  $("#fileRoot").val(fullPath);
  storeLocalVal("fileRoot")
  // $('#' + id).prop('disabled', true)
});
}

Ans this is th actual brows function:

async function openBrowsButton() {
   const fs = require('uxp').storage.localFileSystem;
   let userFolder = await fs.getFolder();  // folder picker
   fullPath = userFolder.nativePath;
   return fullPath;
}

What should I change in this structure to ‘disable’ PS while browsing?