mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-18 23:04:21 +01:00
fix slices.SortFunc() -- did the API change?
This commit is contained in:
4
nostr.go
4
nostr.go
@@ -243,7 +243,7 @@ func authorLastNotes(ctx context.Context, pubkey string, relays []string, isSite
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sort before returning
|
// sort before returning
|
||||||
slices.SortFunc(lastNotes, func(a, b *nostr.Event) bool { return a.CreatedAt > b.CreatedAt })
|
slices.SortFunc(lastNotes, func(a, b *nostr.Event) int { return int(a.CreatedAt - b.CreatedAt) })
|
||||||
return lastNotes
|
return lastNotes
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ func relayLastNotes(ctx context.Context, relayUrl string, isSitemap bool) []*nos
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
slices.SortFunc(lastNotes, func(a, b *nostr.Event) bool { return a.CreatedAt > b.CreatedAt })
|
slices.SortFunc(lastNotes, func(a, b *nostr.Event) int { return int(a.CreatedAt - b.CreatedAt) })
|
||||||
if len(lastNotes) > 0 {
|
if len(lastNotes) > 0 {
|
||||||
cache.SetJSONWithTTL(key, lastNotes, time.Hour*24)
|
cache.SetJSONWithTTL(key, lastNotes, time.Hour*24)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user