popup/popup.js
/**
 * Reflect the response status to modals
 */
Reflect the response status to modals
Reflect the response status to modals
function handleResponse(response, autoCopy) {
  if (!response.success) {
    showFailureModal(response.output);
  } else {
    const successModal = document.getElementById('resultSuccess');
    const failureModal = document.getElementById('resultFailure');
    grandResult.value = response.output;
    grandResult.innerText = response.output;
    toggleModals(successModal, failureModal);
    if (autoCopy) {
      navigator.clipboard.writeText(response.output);
      const copyPrompt = document.getElementById('copyPrompt');
      copyPrompt.innerText = 'Link automatically copied to clipboard\nClick on link to copy again';
    }
  }
}
function handleResponse ( response , autoCopy ) { if ( ! response . success ) { showFailureModal ( response . output ) ; } else { const successModal = document . getElementById ( 'resultSuccess' ) ; const failureModal = document . getElementById ( 'resultFailure' ) ; grandResult . value = response . output ; grandResult . innerText = response . output ; toggleModals ( successModal , failureModal ) ; if ( autoCopy ) { navigator . clipboard . writeText ( response . output ) ; const copyPrompt = document . getElementById ( 'copyPrompt' ) ; copyPrompt . innerText = 'Link automatically copied to clipboard\nClick on link to copy again' ; } } }
Reflect the response status to modals
Reflect the response status to modals