mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-19 12:51:51 +03:00
Correctly show unread status in sidebar
This commit is contained in:
parent
65aa84e5a0
commit
4173f80b67
@ -63,9 +63,23 @@ export class Root extends Component {
|
||||
if (messages[cir].length === 0) {
|
||||
unreads[cir] = false;
|
||||
} else {
|
||||
unreads[cir] =
|
||||
state.configs[cir].red <
|
||||
messages[cir][messages[cir].length - 1].num;
|
||||
let host = `~${window.ship}`;
|
||||
let circle = cir.split('/')[1];
|
||||
let internalStation = host + '/hall-internal-' + circle;
|
||||
|
||||
if (internalStation in state.configs) {
|
||||
console.log(state.configs[internalStation].red, messages[cir]);
|
||||
|
||||
unreads[cir] =
|
||||
state.configs[internalStation].red <=
|
||||
messages[cir][messages[cir].length - 1].num;
|
||||
} else {
|
||||
console.log(cir, messages[cir], state.configs[cir].red);
|
||||
|
||||
unreads[cir] =
|
||||
state.configs[cir].red <=
|
||||
messages[cir][messages[cir].length - 1].num;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unreads[cir] = false;
|
||||
|
@ -76,13 +76,7 @@ export class Sidebar extends Component {
|
||||
return b.wen - a.wen;
|
||||
})
|
||||
.map((obj) => {
|
||||
let host = `~${window.ship}`;
|
||||
let circle = obj.cir.split('/')[1];
|
||||
|
||||
let unread = props.unreads[obj.cir];
|
||||
if (host + '/hall-internal-' + circle in props.unreads) {
|
||||
unread = props.unreads[host + '/hall-internal-' + circle];
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarItem
|
||||
|
Loading…
Reference in New Issue
Block a user