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
b7e1dd38
Unverified
Commit
b7e1dd38
authored
3 months ago
by
Aleksander Nicacio da Silva
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: VoIP not invalidating cache on permission change (#34102)
parent
94aa6af8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.changeset/metal-wolves-explode.md
+5
-0
5 additions, 0 deletions
.changeset/metal-wolves-explode.md
packages/ui-voip/src/hooks/useVoipClient.tsx
+3
-4
3 additions, 4 deletions
packages/ui-voip/src/hooks/useVoipClient.tsx
with
8 additions
and
4 deletions
.changeset/metal-wolves-explode.md
0 → 100644
+
5
−
0
View file @
b7e1dd38
---
"
@rocket.chat/ui-voip"
:
patch
---
Fixes an issue preventing VoIP permission updates from being properly reflected in the UI.
This diff is collapsed.
Click to expand it.
packages/ui-voip/src/hooks/useVoipClient.tsx
+
3
−
4
View file @
b7e1dd38
import
{
useUser
,
useEndpoint
,
useSetting
}
from
'
@rocket.chat/ui-contexts
'
;
import
{
useUser
,
useEndpoint
}
from
'
@rocket.chat/ui-contexts
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useEffect
,
useRef
}
from
'
react
'
;
import
VoipClient
from
'
../lib/VoipClient
'
;
import
{
useWebRtcServers
}
from
'
./useWebRtcServers
'
;
import
VoipClient
from
'
../lib/VoipClient
'
;
type
VoipClientParams
=
{
enabled
?:
boolean
;
...
...
@@ -17,7 +17,6 @@ type VoipClientResult = {
export
const
useVoipClient
=
({
enabled
=
true
,
autoRegister
=
true
}:
VoipClientParams
=
{}):
VoipClientResult
=>
{
const
{
_id
:
userId
}
=
useUser
()
||
{};
const
isVoipEnabled
=
useSetting
(
'
VoIP_TeamCollab_Enabled
'
,
false
);
const
voipClientRef
=
useRef
<
VoipClient
|
null
>
(
null
);
const
getRegistrationInfo
=
useEndpoint
(
'
GET
'
,
'
/v1/voip-freeswitch.extension.getRegistrationInfoByUserId
'
);
...
...
@@ -25,7 +24,7 @@ export const useVoipClient = ({ enabled = true, autoRegister = true }: VoipClien
const
iceServers
=
useWebRtcServers
();
const
{
data
:
voipClient
,
error
}
=
useQuery
<
VoipClient
|
null
,
Error
>
(
[
'
voip-client
'
,
isVoipE
nabled
,
userId
,
iceServers
],
[
'
voip-client
'
,
e
nabled
,
userId
,
iceServers
],
async
()
=>
{
if
(
voipClientRef
.
current
)
{
voipClientRef
.
current
.
clear
();
...
...
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