Open the deletion token copy prompt when creating a paste

This commit is contained in:
Lukas SP 2020-08-26 20:47:15 +02:00
parent 76515c0108
commit f63b94f8c1
1 changed files with 4 additions and 1 deletions

View File

@ -62,6 +62,9 @@ export function setupButtons() {
}
const data = await response.json();
// Give the user the chance to copy the deletion token
prompt("The deletion token for your paste is:", data.deletionToken);
// Redirect the user to the paste page
let address = location.protocol + "//" + location.host + "/" + data.id;
if (data.suggestedSyntaxType) address += "." + data.suggestedSyntaxType;
@ -75,7 +78,7 @@ export function setupButtons() {
document.getElementById("btn_delete").addEventListener("click", function() {
spinner.surround(async function() {
// Ask the user for the deletion token
const deletionToken = window.prompt("Deletion Token:");
const deletionToken = prompt("Deletion Token:");
if (!deletionToken) return;
// Delete the paste