Fix: Once a paste is deleted, navigate to

the home page after 5 seconds; change type
of the corresponding alert to alert-success
This commit is contained in:
parthiv-m 2024-10-07 17:42:37 -04:00
parent 545ef9f64a
commit d69d29f3a9
3 changed files with 6 additions and 3 deletions

View File

@ -5626,8 +5626,11 @@ 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
// access), redirect to baseurl after 5 seconds
if (Model.hasDeleteToken()) {
setTimeout(() => {
UiHelper.reloadHome();
}, 5000);
return;
}

View File

@ -490,7 +490,7 @@ if ($FILEUPLOAD) :
<?php
endif;
?>
<div id="status" role="alert" class="alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
<div id="status" role="alert" class="alert alert-<?php echo $STATUS === 'Paste was properly deleted.' ? 'success' : 'info' ?><?php echo empty($STATUS) ? ' hidden' : '' ?>">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
<?php echo I18n::encode($STATUS), PHP_EOL; ?>
</div>

View File

@ -353,7 +353,7 @@ if ($FILEUPLOAD) :
<?php
endif;
?>
<div id="status" role="alert" class="alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
<div id="status" role="alert" class="alert alert-<?php $STATUS == 'Paste was properly deleted.' ? 'success' : 'info' ?><?php echo empty($STATUS) ? ' hidden' : '' ?>">
<svg width="16" height="16" fill="currentColor" aria-hidden="true"><use href="img/bootstrap-icons.svg#info-circle" /></svg>
<?php echo I18n::encode($STATUS), PHP_EOL; ?>
</div>