js: don't abort on issues created in a closed state

This commit is contained in:
Frédéric Péters 2022-07-18 21:00:05 +02:00
parent 018a02ca2e
commit d5e8db37a9
1 changed files with 6 additions and 4 deletions

View File

@ -253,10 +253,12 @@ function alter_issue_show_page() {
if ($('div.issue.closed').length) { /* on a closed issue */
var last_activity_url = $('#history a[href*=activity]').last().attr('href');
var date = new Date(last_activity_url.split('=')[1]);
var today = new Date();
if (today - date > (60 * 86400*1000)) { /* older than 60 days */
$('div#content > div.contextual .icon-edit').hide();
if (typeof last_activity_url !== 'undefined') {
var date = new Date(last_activity_url.split('=')[1]);
var today = new Date();
if (today - date > (60 * 86400*1000)) { /* older than 60 days */
$('div#content > div.contextual .icon-edit').hide();
}
}
}