function closeOnBlurCallback() {
  const isDevToolsFocused = assistantWindow.webContents.isDevToolsFocused();
  const isCloseOnBlurAllowed = ipcRenderer.sendSync('get-allow-close-on-blur');

  // Only close when not focusing DevTools and
  // the application is initialized properly
  if (!isDevToolsFocused && initScreenFlag && isCloseOnBlurAllowed) {
    stopAudioAndMic();
    close();
  }

  // Reset `allowCloseOnBlur` if already set to `false`
  ipcRenderer.sendSync('set-allow-close-on-blur', true);
}
Callback function called when the application
requests to close the window when out of focus.