Change order of execution to detect delete token properly

This commit is contained in:
Haocen Xu 2020-05-30 06:00:17 -04:00
parent e298c3d10c
commit 25a39148a8
No known key found for this signature in database
GPG Key ID: 3F0D955A0F6AD729
1 changed files with 6 additions and 5 deletions

View File

@ -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();