lotus(#6): render decoration in MediaView; fix store lifecycle
Review found in-call tiles use MediaView->Avatar, not TileAvatar, so the decoration never rendered in-call (CRITICAL). Move the overlay into MediaView, gated on the avatar's own visibility (!(video && videoEnabled)) so it never floats over live video; revert the TileAvatar changes. Also ref-count the io.lotus.decorations registration (one shared handler, no double-reply) and stop clearing the map on teardown so a transient remount doesn't drop decorations (HIGH/MED). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
70358d442b
commit
33d0e98eb0
@@ -22,6 +22,7 @@ import { ErrorSolidIcon } from "@vector-im/compound-design-tokens/assets/web/ico
|
||||
|
||||
import styles from "./MediaView.module.css";
|
||||
import { Avatar } from "../Avatar";
|
||||
import { useLotusDecoration } from "../lotus/lotusDecorations";
|
||||
import { RaisedHandIndicator } from "../reactions/RaisedHandIndicator";
|
||||
import {
|
||||
showConnectionStats as showConnectionStatsSetting,
|
||||
@@ -91,6 +92,7 @@ export const MediaView: FC<Props> = ({
|
||||
...props
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const decoration = useLotusDecoration(userId);
|
||||
const [handRaiseTimerVisible] = useSetting(showHandRaisedTimer);
|
||||
const [showConnectionStats] = useSetting(showConnectionStatsSetting);
|
||||
|
||||
@@ -137,6 +139,17 @@ export const MediaView: FC<Props> = ({
|
||||
})}
|
||||
style={{ display: video && videoEnabled ? "none" : "initial" }}
|
||||
/>
|
||||
{decoration && !(video && videoEnabled) && (
|
||||
// [lotus #6] Profile decoration overlay, shown only when the avatar
|
||||
// is visible (i.e. not when live video is showing). Pushed by the
|
||||
// host via io.lotus.decorations; undefined unless opted in.
|
||||
<img
|
||||
className={styles.lotusDecoration}
|
||||
src={decoration}
|
||||
alt=""
|
||||
aria-hidden
|
||||
/>
|
||||
)}
|
||||
{video?.publication !== undefined && (
|
||||
<VideoTrack
|
||||
trackRef={video}
|
||||
|
||||
Reference in New Issue
Block a user