diff --git a/client/web/src/plugin/component/index.tsx b/client/web/src/plugin/component/index.tsx index 1d3a88b8..31eaae35 100644 --- a/client/web/src/plugin/component/index.tsx +++ b/client/web/src/plugin/component/index.tsx @@ -77,3 +77,4 @@ export { } from '@/components/JumpToButton'; export { NoData } from '@/components/NoData'; export { NotFound } from '@/components/NotFound'; +export { withKeepAliveOverlay } from '@/components/KeepAliveOverlay/withKeepAliveOverlay'; diff --git a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/LivekitView.tsx b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/LivekitView.tsx index 1f0e635a..1e3fde57 100644 --- a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/LivekitView.tsx +++ b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/LivekitView.tsx @@ -1,4 +1,5 @@ import { showErrorToasts, useEvent } from '@capital/common'; +import { withKeepAliveOverlay } from '@capital/component'; import React, { useState } from 'react'; import type { LocalUserChoices } from '@livekit/components-react'; import { PreJoinView } from './lib/PreJoinView'; @@ -10,7 +11,7 @@ interface LivekitViewProps { roomName: string; url: string; } -export const LivekitView: React.FC = React.memo((props) => { +const _LivekitView: React.FC = React.memo((props) => { const [preJoinChoices, setPreJoinChoices] = useState< LocalUserChoices | undefined >(undefined); @@ -54,4 +55,8 @@ export const LivekitView: React.FC = React.memo((props) => { ); }); -LivekitView.displayName = 'LivekitView'; +_LivekitView.displayName = 'LivekitView'; + +export const LivekitView = withKeepAliveOverlay(_LivekitView, { + cacheId: (props) => props.url, +}); diff --git a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/group/LivekitPanel.tsx b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/group/LivekitPanel.tsx index a73bb3b2..15fd4455 100644 --- a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/group/LivekitPanel.tsx +++ b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/group/LivekitPanel.tsx @@ -10,7 +10,11 @@ export const LivekitGroupPanel: React.FC = React.memo(() => { return ( - + ); });