File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed
Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 11import type { OauthConfig } from '@rocket.chat/core-typings' ;
2- import { Meteor } from 'meteor/meteor ' ;
3- import { Tracker } from 'meteor/tracker ' ;
2+ import { useSetting } from '@rocket.chat/ui-contexts ' ;
3+ import { useEffect } from 'react ' ;
44
5- import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth' ;
6- import { settings } from '../../settings/client' ;
5+ import { CustomOAuth } from '../../../custom-oauth/client/CustomOAuth' ;
76
87// Drupal Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/drupal
98// In RocketChat -> Administration the URL needs to be http(s)://{drupal.server}/
@@ -26,11 +25,13 @@ const config: OauthConfig = {
2625
2726const Drupal = new CustomOAuth ( 'drupal' , config ) ;
2827
29- Meteor . startup ( ( ) => {
30- Tracker . autorun ( ( ) => {
31- if ( settings . get ( 'API_Drupal_URL' ) ) {
32- config . serverURL = settings . get ( 'API_Drupal_URL' ) ;
28+ export const useDrupal = ( ) => {
29+ const drupalUrl = useSetting ( 'API_Drupal_URL' ) as string ;
30+
31+ useEffect ( ( ) => {
32+ if ( drupalUrl ) {
33+ config . serverURL = drupalUrl ;
3334 Drupal . configure ( config ) ;
3435 }
35- } ) ;
36- } ) ;
36+ } , [ drupalUrl ] ) ;
37+ } ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import '../app/autotranslate/client';
55import '../app/canned-responses/client' ;
66import '../app/custom-sounds/client' ;
77import '../app/dolphin/client' ;
8- import '../app/drupal/client' ;
98import '../app/emoji/client' ;
109import '../app/emoji-emojione/client' ;
1110import '../app/emoji-custom/client' ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { useGoogleTagManager } from './hooks/useGoogleTagManager';
77import { useMessageLinkClicks } from './hooks/useMessageLinkClicks' ;
88import { useSettingsOnLoadSiteUrl } from './hooks/useSettingsOnLoadSiteUrl' ;
99import { useAnalytics } from '../../../app/analytics/client/loadScript' ;
10+ import { useDrupal } from '../../../app/drupal/client/hooks/useDrupal' ;
1011import { useGitHubEnterpriseAuth } from '../../../app/github-enterprise/client/hooks/useGitHubEnterpriseAuth' ;
1112import { useGitLabAuth } from '../../../app/gitlab/client/hooks/useGitLabAuth' ;
1213import { useLivechatEnterprise } from '../../../app/livechat-enterprise/hooks/useLivechatEnterprise' ;
@@ -39,6 +40,7 @@ const AppLayout = () => {
3940 useNextcloud ( ) ;
4041 useGitLabAuth ( ) ;
4142 useGitHubEnterpriseAuth ( ) ;
43+ useDrupal ( ) ;
4244
4345 const layout = useSyncExternalStore ( appLayout . subscribe , appLayout . getSnapshot ) ;
4446
You can’t perform that action at this time.
0 commit comments