From 25a39148a81deaf50fab50bb53aa7c587c276408 Mon Sep 17 00:00:00 2001 From: Haocen Xu Date: Sat, 30 May 2020 06:00:17 -0400 Subject: [PATCH] Change order of execution to detect delete token properly --- js/privatebin.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 98d9c9a..2926577 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -5373,6 +5373,12 @@ jQuery.PrivateBin = (function($, RawDeflate) { } me.initZ(); + // if delete token is passed (i.e. paste has been deleted by this + // access), there is nothing more to do + if (Model.hasDeleteToken()) { + return; + } + // check whether existing paste needs to be shown try { Model.getPasteId(); @@ -5381,11 +5387,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { return me.newPaste(); } - // if delete token is passed (i.e. paste has been deleted by this - // access), there is nothing more to do - if (Model.hasDeleteToken()) { - return; - } // always reload on back button to invalidate cache(protect burn after read paste) window.addEventListener('popstate', () => { window.location.reload();