From 9c5c60143975a120bf70ac4aed34bf903ef19db6 Mon Sep 17 00:00:00 2001 From: puni9869 <80308335+puni9869@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:42:20 +0530 Subject: [PATCH] Fix archived unix time when archiving the label (#26681) Small Fix :-`ArchivedUnix` column changed only change the date when it is newly archived. Co-authored-by: Giteabot --- models/issues/label.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/models/issues/label.go b/models/issues/label.go index 70906efb4..0087c933a 100644 --- a/models/issues/label.go +++ b/models/issues/label.go @@ -113,10 +113,11 @@ func (l *Label) CalOpenIssues() { // SetArchived set the label as archived func (l *Label) SetArchived(isArchived bool) { - if isArchived && l.ArchivedUnix.IsZero() { - l.ArchivedUnix = timeutil.TimeStampNow() - } else { + if !isArchived { l.ArchivedUnix = timeutil.TimeStamp(0) + } else if isArchived && l.ArchivedUnix.IsZero() { + // Only change the date when it is newly archived. + l.ArchivedUnix = timeutil.TimeStampNow() } }