mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-29 04:04:02 +03:00
groups: fix notification order
This commit is contained in:
parent
a38d5db9e3
commit
952a05a901
@ -66,7 +66,7 @@ export function Notification(props: {
|
|||||||
const key = `${harkLidToId(lid)}-${harkBinToId(notification.bin)}`;
|
const key = `${harkLidToId(lid)}-${harkBinToId(notification.bin)}`;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const isMobile = useLocalState((s) => s.mobile);
|
const isMobile = useLocalState(s => s.mobile);
|
||||||
|
|
||||||
const onArchive = useCallback(
|
const onArchive = useCallback(
|
||||||
async (e) => {
|
async (e) => {
|
||||||
@ -80,8 +80,10 @@ export function Notification(props: {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const { hovering, bind } = useHovering();
|
const { hovering, bind } = useHovering();
|
||||||
const dedupedBody = uniqBy(notification.body, (item) => item.link);
|
const dedupedBody = uniqBy(notification.body, item => item.link);
|
||||||
const contents = map(dedupedBody, 'content').filter((c) => c.length > 0);
|
// @ts-ignore TODO fix HarkBody definition for time, is string, should be number.
|
||||||
|
const orderedByTime = dedupedBody.sort((a, b) => b.time - a.time);
|
||||||
|
const contents = map(orderedByTime, 'content').filter(c => c.length > 0);
|
||||||
const first = notification.body[0];
|
const first = notification.body[0];
|
||||||
if (!first) {
|
if (!first) {
|
||||||
// should be unreachable
|
// should be unreachable
|
||||||
|
Loading…
Reference in New Issue
Block a user