diff --git a/.changeset/tame-falcons-watch.md b/.changeset/tame-falcons-watch.md new file mode 100644 index 0000000000000..99f0629fb4fb9 --- /dev/null +++ b/.changeset/tame-falcons-watch.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Remove useCorsSSLConfig hook and absoluteUrl startup patch (dead code after Meteor DDP removal) diff --git a/apps/meteor/client/meteor/startup/absoluteUrl.ts b/apps/meteor/client/meteor/startup/absoluteUrl.ts deleted file mode 100644 index a1fe3938e06f7..0000000000000 --- a/apps/meteor/client/meteor/startup/absoluteUrl.ts +++ /dev/null @@ -1,11 +0,0 @@ -// TODO: remove this file together with the Meteor webapp/DDP layer — it only -// exists to patch Meteor.absoluteUrl's rootUrl, which no longer has a caller -// once DDP is gone. -import { Meteor } from 'meteor/meteor'; - -import { _relativeToSiteRootUrl, absoluteUrl } from '../../lib/absoluteUrl'; - -Object.assign(Meteor, { - absoluteUrl, - _relativeToSiteRootUrl, -}); diff --git a/apps/meteor/client/meteor/startup/index.ts b/apps/meteor/client/meteor/startup/index.ts index 286913b22c6a4..7e86a46fb0578 100644 --- a/apps/meteor/client/meteor/startup/index.ts +++ b/apps/meteor/client/meteor/startup/index.ts @@ -1,2 +1 @@ -import './absoluteUrl'; import './accounts'; diff --git a/apps/meteor/client/views/root/AppLayout.tsx b/apps/meteor/client/views/root/AppLayout.tsx index b355d9c7b44f2..af47bd1df7de5 100644 --- a/apps/meteor/client/views/root/AppLayout.tsx +++ b/apps/meteor/client/views/root/AppLayout.tsx @@ -15,7 +15,6 @@ import { useAnalytics } from './hooks/useAnalytics'; import { useAnalyticsEventTracking } from './hooks/useAnalyticsEventTracking'; import { useAutoupdate } from './hooks/useAutoupdate'; import { useCodeHighlight } from './hooks/useCodeHighlight'; -import { useCorsSSLConfig } from './hooks/useCorsSSLConfig'; import { useDesktopFavicon } from './hooks/useDesktopFavicon'; import { useDesktopTitle } from './hooks/useDesktopTitle'; import { useEmojiOne } from './hooks/useEmojiOne'; @@ -66,7 +65,6 @@ const AppLayout = () => { useAppleOAuth(); useWordPressOAuth(); useCustomOAuth(); - useCorsSSLConfig(); useAutoupdate(); useCodeHighlight(); useLoginViaQuery(); diff --git a/apps/meteor/client/views/root/hooks/useCorsSSLConfig.ts b/apps/meteor/client/views/root/hooks/useCorsSSLConfig.ts deleted file mode 100644 index f506f655af12d..0000000000000 --- a/apps/meteor/client/views/root/hooks/useCorsSSLConfig.ts +++ /dev/null @@ -1,15 +0,0 @@ -// TODO: remove this hook together with the Meteor webapp/DDP layer — it only -// patches Meteor.absoluteUrl's `secure` default, which has no consumers once -// Meteor.absoluteUrl is gone. -import { useSetting } from '@rocket.chat/ui-contexts'; -import { useEffect } from 'react'; - -import { absoluteUrl } from '../../../lib/absoluteUrl'; - -export const useCorsSSLConfig = () => { - const forceSSlSetting = useSetting('Force_SSL'); - - useEffect(() => { - absoluteUrl.defaultOptions.secure = Boolean(forceSSlSetting); - }, [forceSSlSetting]); -};