mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
grid: fix notification ordering
This commit is contained in:
parent
f2e1e2fe93
commit
ea47640344
@ -34,7 +34,7 @@ export const BasicNotification = ({ notification, unread = false }: BasicNotific
|
||||
|
||||
const charge = useCharge(desk);
|
||||
const first = notification.body?.[0];
|
||||
if (!first) {
|
||||
if (!first || !charge) {
|
||||
return null;
|
||||
}
|
||||
const contents = map(notification.body, 'content').filter((c) => c.length > 0);
|
||||
|
@ -19,7 +19,7 @@ export const RuntimeLagNotification = () => (
|
||||
<header id="system-updates-blocked" className="relative -left-8 space-y-2">
|
||||
<div className="flex space-x-2">
|
||||
<span className="inline-block w-6 h-6 bg-orange-500 rounded-full" />
|
||||
<span className="font-medium">Landscape</span>
|
||||
<span className="font-medium">Grid</span>
|
||||
</div>
|
||||
<div className="flex space-x-2">
|
||||
<Elbow className="w-6 h-6 text-gray-300" />
|
||||
|
@ -63,7 +63,7 @@ function reduceHark(u: any) {
|
||||
set((state) => {
|
||||
state.unreads = state.unreads.filter((unread) => !harkBinEq(unread.bin, u.added.bin));
|
||||
|
||||
state.unreads.push(u.added);
|
||||
state.unreads.unshift(u.added);
|
||||
});
|
||||
} else if ('timebox' in u) {
|
||||
const { timebox } = u;
|
||||
@ -78,6 +78,18 @@ function reduceHark(u: any) {
|
||||
state.unreads = [...state.unreads, ...notifications];
|
||||
});
|
||||
}
|
||||
} else if ('archive' in u) {
|
||||
console.log(u.archive);
|
||||
set((state) => {
|
||||
const time = u.archive?.time;
|
||||
if (time) {
|
||||
let box = state.reads.get(makePatDa(time)) || [];
|
||||
box = box.filter((n) => !harkBinEq(u.archive.bin, n.bin));
|
||||
state.reads = state.reads.set(makePatDa(time), box);
|
||||
} else {
|
||||
state.unreads = state.unreads.filter((n) => !harkBinEq(u.archive.bin, n.bin));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user