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
e8baaecd
Unverified
Commit
e8baaecd
authored
6 months ago
by
Guilherme Gazzo
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: prevent uiInteraction to invalidate multiple times (#33216)
parent
532f0881
No related branches found
Branches containing commit
Tags
6.12.0
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.changeset/rich-toes-bow.md
+5
-0
5 additions, 0 deletions
.changeset/rich-toes-bow.md
apps/meteor/client/hooks/useAppUiKitInteraction.ts
+4
-4
4 additions, 4 deletions
apps/meteor/client/hooks/useAppUiKitInteraction.ts
with
9 additions
and
4 deletions
.changeset/rich-toes-bow.md
0 → 100644
+
5
−
0
View file @
e8baaecd
---
"
@rocket.chat/meteor"
:
patch
---
Prevented uiInteraction to subscribe multiple times
This diff is collapsed.
Click to expand it.
apps/meteor/client/hooks/useAppUiKitInteraction.ts
+
4
−
4
View file @
e8baaecd
import
{
useEffectEvent
}
from
'
@rocket.chat/fuselage-hooks
'
;
import
{
useStream
,
useUserId
}
from
'
@rocket.chat/ui-contexts
'
;
import
type
*
as
UiKit
from
'
@rocket.chat/ui-kit
'
;
import
{
useEffect
}
from
'
react
'
;
...
...
@@ -6,13 +7,12 @@ export const useAppUiKitInteraction = (handleServerInteraction: (interaction: Ui
const
notifyUser
=
useStream
(
'
notify-user
'
);
const
uid
=
useUserId
();
const
handle
=
useEffectEvent
(
handleServerInteraction
);
useEffect
(()
=>
{
if
(
!
uid
)
{
return
;
}
return
notifyUser
(
`
${
uid
}
/uiInteraction`
,
(
interaction
)
=>
{
handleServerInteraction
(
interaction
);
});
},
[
notifyUser
,
uid
,
handleServerInteraction
]);
return
notifyUser
(
`
${
uid
}
/uiInteraction`
,
handle
);
},
[
notifyUser
,
uid
,
handle
]);
};
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