mirror of
https://github.com/charmbracelet/glow
synced 2024-12-13 13:42:34 +00:00
Sort local ID as a last resort as not all markdowns will have an SQL ID
This commit is contained in:
parent
ca0dfecb1c
commit
84843e4f13
1 changed files with 4 additions and 2 deletions
|
@ -89,8 +89,10 @@ func (m markdownsByLocalFirst) Less(i, j int) bool {
|
|||
return m[i].CreatedAt.After(m[j].CreatedAt)
|
||||
}
|
||||
|
||||
// If the timestamps also match, sort by ID.
|
||||
return m[i].ID > m[j].ID
|
||||
// If the timestamps also match, sort by local ID.
|
||||
localIDs := []ksuid.KSUID{m[i].localID, m[j].localID}
|
||||
ksuid.Sort(localIDs)
|
||||
return localIDs[0] == m[i].localID
|
||||
}
|
||||
|
||||
func (m markdown) relativeTime() string {
|
||||
|
|
Loading…
Reference in a new issue