function DrawerBreadcrumb({ spaceId }) {
const [, forceUpdate] = useState({});
const scrollRef = useRef(null);
- const { roomList, notifications } = initMatrix;
+ const { roomList, notifications, accountData } = initMatrix;
const mx = initMatrix.matrixClient;
const spacePath = navigation.selectedSpacePath;
}, [spaceId]);
function getHomeNotiExcept(childId) {
- const orphans = roomList.getOrphans();
- const childIndex = orphans.indexOf(childId);
- if (childId !== -1) orphans.splice(childIndex, 1);
+ const orphans = roomList.getOrphans()
+ .filter((id) => (id !== childId))
+ .filter((id) => !accountData.spaceShortcut.has(id));
let noti = null;
}
getTotalNoti(roomId) {
- const { total, highlight } = this.getNoti(roomId);
- if (highlight > total) return highlight;
+ const { total } = this.getNoti(roomId);
return total;
}
_setNoti(roomId, total, highlight) {
const addNoti = (id, t, h, fromId) => {
- const prevTotal = this.roomIdToNoti.get(id)?.total ?? null;
+ const prevTotal = this.roomIdToNoti.has(id) ? this.getT : null;
const noti = this.getNoti(id);
noti.total += t;
};
const noti = this.getNoti(roomId);
- const addT = total - noti.total;
+ const addT = (highlight > total ? highlight : total) - noti.total;
const addH = highlight - noti.highlight;
if (addT < 0 || addH < 0) return;