mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02: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…
Add table
Add a link
Reference in a new issue