mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-10 17:20:28 +03:00
Remove no longer needed files
This commit is contained in:
parent
3bd7588497
commit
5481595a67
2 changed files with 0 additions and 64 deletions
|
|
@ -1,35 +0,0 @@
|
|||
import React, { useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { logger } from 'matrix-js-sdk/lib/logger';
|
||||
|
||||
import { useCallState } from '../client/CallProvider';
|
||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||
|
||||
export function CallActivationEffect() {
|
||||
const { roomIdOrAlias: viewedRoomId } = useParams<{ roomIdOrAlias: string }>();
|
||||
const { activeCallRoomId, isCallActive, setActiveCallRoomId } = useCallState();
|
||||
const mx = useMatrixClient();
|
||||
const room = mx.getRoom(viewedRoomId);
|
||||
|
||||
useEffect(() => {
|
||||
if (!viewedRoomId || !mx) {
|
||||
logger.error('CallActivationEffect: Missing viewedRoomId or MatrixClient.');
|
||||
return;
|
||||
}
|
||||
|
||||
const isViewingCallRoom = room?.isCallRoom?.() ?? false;
|
||||
|
||||
if (isViewingCallRoom) {
|
||||
if (viewedRoomId !== activeCallRoomId && !isCallActive) {
|
||||
logger.info(`CallActivationEffect: Auto-activating call for viewed room: ${viewedRoomId}`);
|
||||
//setActiveCallRoomId(viewedRoomId);
|
||||
} else {
|
||||
logger.debug(
|
||||
`CallActivationEffect: Viewed room ${viewedRoomId} is already the active call.`
|
||||
);
|
||||
}
|
||||
}
|
||||
}, [viewedRoomId, activeCallRoomId, setActiveCallRoomId, isCallActive, mx, room]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
import React, { ReactNode } from "react";
|
||||
import { useSelectedRoom } from "../../hooks/router/useSelectedRoom";
|
||||
import { useMatrixClient } from "../../hooks/useMatrixClient";
|
||||
import { PowerLevelsContextProvider, usePowerLevels } from "../../hooks/usePowerLevels";
|
||||
import { RouteSpaceProvider, SpaceRouteRoomProvider } from "../client/space";
|
||||
|
||||
|
||||
|
||||
type PowerLevelsContainerProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
export function PowerLevelsContainer({ children }: PowerLevelsContainerProps) {
|
||||
|
||||
const mx = useMatrixClient();
|
||||
const roomId = useSelectedRoom();
|
||||
const room = mx.getRoom(roomId);
|
||||
const powerLevels = usePowerLevels(room ?? null);
|
||||
|
||||
|
||||
return (
|
||||
<PowerLevelsContextProvider value={powerLevels}>
|
||||
<RouteSpaceProvider>
|
||||
<SpaceRouteRoomProvider>
|
||||
{ children }
|
||||
</SpaceRouteRoomProvider>
|
||||
</RouteSpaceProvider>
|
||||
</PowerLevelsContextProvider>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue