Skip to content

Commit 9c5c601

Browse files
puni9869GiteaBot
andauthored
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 <[email protected]>
1 parent e8b9909 commit 9c5c601

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

models/issues/label.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ func (l *Label) CalOpenIssues() {
113113

114114
// SetArchived set the label as archived
115115
func (l *Label) SetArchived(isArchived bool) {
116-
if isArchived && l.ArchivedUnix.IsZero() {
117-
l.ArchivedUnix = timeutil.TimeStampNow()
118-
} else {
116+
if !isArchived {
119117
l.ArchivedUnix = timeutil.TimeStamp(0)
118+
} else if isArchived && l.ArchivedUnix.IsZero() {
119+
// Only change the date when it is newly archived.
120+
l.ArchivedUnix = timeutil.TimeStampNow()
120121
}
121122
}
122123

0 commit comments

Comments
 (0)