Skip to content

Commit 57e4c74

Browse files
committed
chore: remove reload from useForceLogout
1 parent f0e36d7 commit 57e4c74

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

apps/meteor/client/views/root/hooks/loggedIn/useForceLogout.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useStream, useSessionDispatch } from '@rocket.chat/ui-contexts';
2-
import { Meteor } from 'meteor/meteor';
32
import { useEffect } from 'react';
43

54
export const useForceLogout = (userId: string) => {
@@ -9,13 +8,7 @@ export const useForceLogout = (userId: string) => {
98
useEffect(() => {
109
setForceLogout(false);
1110

12-
const unsubscribe = getNotifyUserStream(`${userId}/force_logout`, (sessionId) => {
13-
const currentSessionId = Meteor.connection._lastSessionId;
14-
15-
if (sessionId === currentSessionId) {
16-
window.location.reload();
17-
}
18-
11+
const unsubscribe = getNotifyUserStream(`${userId}/force_logout`, () => {
1912
setForceLogout(true);
2013
});
2114

apps/meteor/definition/externals/meteor/meteor.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ declare module 'meteor/meteor' {
118118
},
119119
]
120120
): SubscriptionHandle;
121-
_lastSessionId: string;
122121

123122
call(methodName: string, ...args: [...unknown, callback?: (error: Error | null, result: unknown) => void]): void;
124123
}

0 commit comments

Comments
 (0)