Improve-auth-media (#1933)

* fix set power level broken after sdk update

* add media authentication hook

* fix service worker types

* fix service worker not working in dev mode

* fix env mode check when registering sw
This commit is contained in:
Ajay Bura 2024-09-09 18:45:20 +10:00 committed by GitHub
parent 4dfce32730
commit 96df140153
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 100 additions and 124 deletions

View file

@ -38,7 +38,7 @@ import { stopPropagation } from '../../utils/keyboard';
import { getMatrixToRoom } from '../../plugins/matrix-to';
import { getCanonicalAliasOrRoomId, isRoomAlias } from '../../utils/matrix';
import { getViaServers } from '../../plugins/via-servers';
import { useSpecVersions } from '../../hooks/useSpecVersions';
import { useMediaAuthentication } from '../../hooks/useMediaAuthentication';
type RoomNavItemMenuProps = {
room: Room;
@ -176,8 +176,7 @@ export function RoomNavItem({
linkPath,
}: RoomNavItemProps) {
const mx = useMatrixClient();
const { versions } = useSpecVersions();
const useAuthentication = versions.includes('v1.11');
const useAuthentication = useMediaAuthentication();
const [hover, setHover] = useState(false);
const { hoverProps } = useHover({ onHoverChange: setHover });
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setHover });