fix prev logs showing current log.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-11 02:14:01 +02:00
parent 87559997a9
commit a606b79736
+8
View File
@@ -857,6 +857,10 @@ func (s *LogService) NextLogs(ctx context.Context, log *models.Log) ([]*models.L
return logs[i].Date.Before(logs[j].Date)
})
if len(logs) >= 1 && logs[0].ID == log.ID {
logs = logs[1:]
}
return s.findSuggestions(ctx, log, logs)
}
@@ -868,6 +872,10 @@ func (s *LogService) PrevLogs(ctx context.Context, log *models.Log) ([]*models.L
return nil, err
}
if len(logs) >= 1 && logs[0].ID == log.ID {
logs = logs[1:]
}
return s.findSuggestions(ctx, log, logs)
}