fix: startup iframe event (#37718)

Co-authored-by: Júlia Jaeger Foresti <60678893+juliajforesti@users.noreply.github.com>
This commit is contained in:
Yash Rajpal 2025-12-08 23:33:23 +05:30 committed by GitHub
parent b315fba091
commit 27e4252d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---
Fixes the missing dispatch of `startup` iframe event on client startup.

View File

@ -10,8 +10,6 @@ import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent';
import { watchUserId } from '../meteor/user';
Meteor.startup(() => {
fireGlobalEvent('startup', true);
let status: UserStatus | undefined = undefined;
Tracker.autorun(async () => {
const uid = watchUserId();

View File

@ -30,6 +30,7 @@ import { useMessageLinkClicks } from './hooks/useMessageLinkClicks';
import { useNotificationPermission } from './hooks/useNotificationPermission';
import { useRedirectToSetupWizard } from './hooks/useRedirectToSetupWizard';
import { useSettingsOnLoadSiteUrl } from './hooks/useSettingsOnLoadSiteUrl';
import { useStartupEvent } from './hooks/useStartupEvent';
import { appLayout } from '../../lib/appLayout';
const AppLayout = () => {
@ -69,6 +70,7 @@ const AppLayout = () => {
useLoadMissedMessages();
useDesktopFavicon();
useDesktopTitle();
useStartupEvent();
const layout = useSyncExternalStore(appLayout.subscribe, appLayout.getSnapshot);

View File

@ -0,0 +1,11 @@
import { useEffect } from 'react';
import { useFireGlobalEvent } from '../../../hooks/useFireGlobalEvent';
export const useStartupEvent = () => {
const { mutate: fireStartupEvent } = useFireGlobalEvent('startup', 'global');
useEffect(() => {
fireStartupEvent(true);
}, [fireStartupEvent]);
};