mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-13 20:27:01 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a3ab440ad3 | |||
| 69199a7ede | |||
| f89bd8401c | |||
| 7b61defe3c |
@@ -17,6 +17,7 @@ import posthog from 'posthog-js'
|
|||||||
import { css } from '@/styled-system/css'
|
import { css } from '@/styled-system/css'
|
||||||
import { LocalUserChoices } from '../routes/Room'
|
import { LocalUserChoices } from '../routes/Room'
|
||||||
import { BackgroundProcessorFactory } from '../livekit/components/blur'
|
import { BackgroundProcessorFactory } from '../livekit/components/blur'
|
||||||
|
import { useUsernameParam } from '@/features/rooms/hooks/useUsernameParam.ts'
|
||||||
|
|
||||||
export const Conference = ({
|
export const Conference = ({
|
||||||
roomId,
|
roomId,
|
||||||
@@ -29,6 +30,8 @@ export const Conference = ({
|
|||||||
mode?: 'join' | 'create'
|
mode?: 'join' | 'create'
|
||||||
initialRoomData?: ApiRoom
|
initialRoomData?: ApiRoom
|
||||||
}) => {
|
}) => {
|
||||||
|
const username = useUsernameParam()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
posthog.capture('visit-room', { slug: roomId })
|
posthog.capture('visit-room', { slug: roomId })
|
||||||
}, [roomId])
|
}, [roomId])
|
||||||
@@ -56,7 +59,7 @@ export const Conference = ({
|
|||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
fetchRoom({
|
fetchRoom({
|
||||||
roomId: roomId as string,
|
roomId: roomId as string,
|
||||||
username: userConfig.username,
|
username: username != null ? username : userConfig.username,
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
if (error.statusCode == '404') {
|
if (error.statusCode == '404') {
|
||||||
createRoom({ slug: roomId, username: userConfig.username })
|
createRoom({ slug: roomId, username: userConfig.username })
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { useSearch } from 'wouter'
|
||||||
|
|
||||||
|
export const useSkipPreJoinParam = () => {
|
||||||
|
const search = useSearch()
|
||||||
|
const params = new URLSearchParams(search)
|
||||||
|
return params.get('skipPreJoin') === 'True'
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { useSearch } from 'wouter'
|
||||||
|
|
||||||
|
export const useUsernameParam = () => {
|
||||||
|
const search = useSearch()
|
||||||
|
const params = new URLSearchParams(search)
|
||||||
|
return params.get('username')
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import { ToggleButton } from '@/primitives'
|
|||||||
import { chatStore } from '@/stores/chat'
|
import { chatStore } from '@/stores/chat'
|
||||||
import { useSidePanel } from '../../hooks/useSidePanel'
|
import { useSidePanel } from '../../hooks/useSidePanel'
|
||||||
import { ToggleButtonProps } from '@/primitives/ToggleButton'
|
import { ToggleButtonProps } from '@/primitives/ToggleButton'
|
||||||
|
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
|
||||||
|
|
||||||
export const ChatToggle = ({
|
export const ChatToggle = ({
|
||||||
onPress,
|
onPress,
|
||||||
@@ -18,6 +19,12 @@ export const ChatToggle = ({
|
|||||||
const { isChatOpen, toggleChat } = useSidePanel()
|
const { isChatOpen, toggleChat } = useSidePanel()
|
||||||
const tooltipLabel = isChatOpen ? 'open' : 'closed'
|
const tooltipLabel = isChatOpen ? 'open' : 'closed'
|
||||||
|
|
||||||
|
const shortcut = {
|
||||||
|
key: 'c',
|
||||||
|
ctrlKey: true,
|
||||||
|
}
|
||||||
|
useRegisterKeyboardShortcut({ shortcut, handler: toggleChat })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={css({
|
className={css({
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
closeLowerHandToasts,
|
closeLowerHandToasts,
|
||||||
showLowerHandToast,
|
showLowerHandToast,
|
||||||
} from '@/features/notifications/utils'
|
} from '@/features/notifications/utils'
|
||||||
|
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
|
||||||
|
|
||||||
const SPEAKING_DETECTION_DELAY = 3000
|
const SPEAKING_DETECTION_DELAY = 3000
|
||||||
|
|
||||||
@@ -24,6 +25,12 @@ export const HandToggle = () => {
|
|||||||
const speakingTimerRef = useRef<NodeJS.Timeout | null>(null)
|
const speakingTimerRef = useRef<NodeJS.Timeout | null>(null)
|
||||||
const [hasShownToast, setHasShownToast] = useState(false)
|
const [hasShownToast, setHasShownToast] = useState(false)
|
||||||
|
|
||||||
|
const shortcut = {
|
||||||
|
key: 'h',
|
||||||
|
ctrlKey: true,
|
||||||
|
}
|
||||||
|
useRegisterKeyboardShortcut({ shortcut, handler: toggleRaisedHand })
|
||||||
|
|
||||||
const resetToastState = () => {
|
const resetToastState = () => {
|
||||||
setHasShownToast(false)
|
setHasShownToast(false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
isRoomValid,
|
isRoomValid,
|
||||||
normalizeRoomId,
|
normalizeRoomId,
|
||||||
} from '@/features/rooms/utils/isRoomValid'
|
} from '@/features/rooms/utils/isRoomValid'
|
||||||
|
import { useSkipPreJoinParam } from '@/features/rooms/hooks/useSkipPreJoinParam.ts'
|
||||||
|
|
||||||
export type LocalUserChoices = LocalUserChoicesLK & {
|
export type LocalUserChoices = LocalUserChoicesLK & {
|
||||||
processorSerialized?: ProcessorSerialized
|
processorSerialized?: ProcessorSerialized
|
||||||
@@ -28,7 +29,9 @@ export const Room = () => {
|
|||||||
const [location, setLocation] = useLocation()
|
const [location, setLocation] = useLocation()
|
||||||
const initialRoomData = history.state?.initialRoomData
|
const initialRoomData = history.state?.initialRoomData
|
||||||
const mode = isLoggedIn && history.state?.create ? 'create' : 'join'
|
const mode = isLoggedIn && history.state?.create ? 'create' : 'join'
|
||||||
const skipJoinScreen = isLoggedIn && mode === 'create'
|
|
||||||
|
const skipPreJoin = useSkipPreJoinParam()
|
||||||
|
const skipJoinScreen = (isLoggedIn && mode === 'create') || skipPreJoin
|
||||||
|
|
||||||
useKeyboardShortcuts()
|
useKeyboardShortcuts()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user