Fix useUnreadNotifications exploding with falsey room, like in notif panel (#10030)
This commit is contained in:
parent
e2af97c4de
commit
262c2fcff2
4 changed files with 11 additions and 7 deletions
|
@ -19,11 +19,11 @@ import { useCallback, useEffect, useState } from "react";
|
|||
|
||||
import type { NotificationCount, Room } from "matrix-js-sdk/src/models/room";
|
||||
import { determineUnreadState } from "../RoomNotifs";
|
||||
import type { NotificationColor } from "../stores/notifications/NotificationColor";
|
||||
import { NotificationColor } from "../stores/notifications/NotificationColor";
|
||||
import { useEventEmitter } from "./useEventEmitter";
|
||||
|
||||
export const useUnreadNotifications = (
|
||||
room: Room,
|
||||
room?: Room,
|
||||
threadId?: string,
|
||||
): {
|
||||
symbol: string | null;
|
||||
|
@ -32,7 +32,7 @@ export const useUnreadNotifications = (
|
|||
} => {
|
||||
const [symbol, setSymbol] = useState<string | null>(null);
|
||||
const [count, setCount] = useState<number>(0);
|
||||
const [color, setColor] = useState<NotificationColor>(0);
|
||||
const [color, setColor] = useState<NotificationColor>(NotificationColor.None);
|
||||
|
||||
useEventEmitter(
|
||||
room,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue