mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
fix: startup iframe event (#37718)
Co-authored-by: Júlia Jaeger Foresti <60678893+juliajforesti@users.noreply.github.com>
This commit is contained in:
parent
b315fba091
commit
27e4252d6c
5
.changeset/tender-wolves-promise.md
Normal file
5
.changeset/tender-wolves-promise.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'@rocket.chat/meteor': patch
|
||||
---
|
||||
|
||||
Fixes the missing dispatch of `startup` iframe event on client startup.
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
11
apps/meteor/client/views/root/hooks/useStartupEvent.ts
Normal file
11
apps/meteor/client/views/root/hooks/useStartupEvent.ts
Normal 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]);
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user