Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
b763c371
Unverified
Commit
b763c371
authored
1 month ago
by
Douglas Fabris
Committed by
GitHub
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Replace `useEndpointData` in VideoConf incoming popup (#35060)
parent
6d78d701
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfPopups/VideoConfPopup/IncomingPopup.tsx
+12
-9
12 additions, 9 deletions
...nference/VideoConfPopups/VideoConfPopup/IncomingPopup.tsx
with
12 additions
and
9 deletions
apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfPopups/VideoConfPopup/IncomingPopup.tsx
+
12
−
9
View file @
b763c371
import
type
{
IRoom
}
from
'
@rocket.chat/core-typings
'
;
import
{
Skeleton
}
from
'
@rocket.chat/fuselage
'
;
import
{
useEffectEvent
}
from
'
@rocket.chat/fuselage-hooks
'
;
import
{
useEndpoint
}
from
'
@rocket.chat/ui-contexts
'
;
import
{
useVideoConfSetPreferences
,
VideoConfPopup
,
...
...
@@ -14,13 +15,11 @@ import {
VideoConfPopupTitle
,
VideoConfPopupHeader
,
}
from
'
@rocket.chat/ui-video-conf
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
type
{
ReactElement
}
from
'
react
'
;
import
{
useMemo
}
from
'
react
'
;
import
{
useTranslation
}
from
'
react-i18next
'
;
import
VideoConfPopupRoomInfo
from
'
./VideoConfPopupRoomInfo
'
;
import
{
AsyncStatePhase
}
from
'
../../../../../../hooks/useAsyncState
'
;
import
{
useEndpointData
}
from
'
../../../../../../hooks/useEndpointData
'
;
type
IncomingPopupProps
=
{
id
:
string
;
...
...
@@ -36,10 +35,14 @@ const IncomingPopup = ({ id, room, position, onClose, onMute, onConfirm }: Incom
const
{
controllersConfig
,
handleToggleMic
,
handleToggleCam
}
=
useVideoConfControllers
();
const
setPreferences
=
useVideoConfSetPreferences
();
const
params
=
useMemo
(()
=>
({
callId
:
id
}),
[
id
]);
const
{
phase
,
value
}
=
useEndpointData
(
'
/v1/video-conference.info
'
,
{
params
});
const
showMic
=
Boolean
(
value
?.
capabilities
?.
mic
);
const
showCam
=
Boolean
(
value
?.
capabilities
?.
cam
);
const
videoConfInfo
=
useEndpoint
(
'
GET
'
,
'
/v1/video-conference.info
'
);
const
{
data
,
isPending
,
isSuccess
}
=
useQuery
({
queryKey
:
[
'
getVideoConferenceInfo
'
,
id
],
queryFn
:
async
()
=>
videoConfInfo
({
callId
:
id
}),
});
const
showMic
=
Boolean
(
data
?.
capabilities
?.
mic
);
const
showCam
=
Boolean
(
data
?.
capabilities
?.
cam
);
const
handleJoinCall
=
useEffectEvent
(()
=>
{
setPreferences
(
controllersConfig
);
...
...
@@ -50,8 +53,8 @@ const IncomingPopup = ({ id, room, position, onClose, onMute, onConfirm }: Incom
<
VideoConfPopup
position
=
{
position
}
>
<
VideoConfPopupHeader
>
<
VideoConfPopupTitle
text
=
{
t
(
'
Incoming_call_from
'
)
}
/>
{
phase
===
AsyncStatePhase
.
LOADING
&&
<
Skeleton
/>
}
{
phase
===
AsyncStatePhase
.
RESOLVED
&&
(
showMic
||
showCam
)
&&
(
{
isPending
&&
<
Skeleton
/>
}
{
isSuccess
&&
(
showMic
||
showCam
)
&&
(
<
VideoConfPopupControllers
>
{
showCam
&&
(
<
VideoConfController
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment