Display WS state in favicon

This commit is contained in:
2025-12-01 08:44:30 +01:00
parent 64985bb39e
commit 7acb0cbafa
3 changed files with 39 additions and 10 deletions

View File

@@ -90,6 +90,7 @@ function _MainMessageWidget(p: {
setRoomMgr(mgr);
};
const [wsState, setWsState] = React.useState("");
const handleWsEvent = (m: WsMessage) => {
// Process messages for current room
if (roomMgr?.processWsMessage(m)) {
@@ -120,11 +121,11 @@ function _MainMessageWidget(p: {
<div style={{ display: "flex", height: "100%" }}>
{/* Websocket */}
<div style={{ position: "absolute", right: "0px", padding: "10px" }}>
<MatrixWS onMessage={handleWsEvent} />
<MatrixWS onMessage={handleWsEvent} onStateChange={setWsState} />
</div>
{/** Application icon modifier */}
<AppIconModifier numberUnread={unreadRooms} />
<AppIconModifier numberUnread={unreadRooms} state={wsState} />
{/* Space selector */}
<SpaceSelector {...p} selectedSpace={space} onChange={setSpace} />