Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(follow-me): disable the auto pin on SS

Hristo Terezov13f76c2cce84
diff --git a/react/features/follow-me/functions.js b/react/features/follow-me/functions.js
new file mode 100644
index 0000000000..ca23a87e31
--- /dev/null
+++ b/react/features/follow-me/functions.js
@@ -0,0 +1,16 @@
+// @flow
+
+import { toState } from '../base/redux';
+
+/**
+ * Returns true if follow me is active and false otherwise.
+ *
+ * @param {Object|Function} stateful - Object or function that can be resolved
+ * to the Redux state.
+ * @returns {boolean} - True if follow me is active and false otherwise.
+ */
+export function isFollowMeActive(stateful: Object | Function) {
+ const state = toState(stateful);
+
+ return Boolean(state['features/follow-me'].moderator);
+}
diff --git a/react/features/follow-me/index.js b/react/features/follow-me/index.js
index fc45b694e4..024c757add 100644
--- a/react/features/follow-me/index.js
+++ b/react/features/follow-me/index.js
@@ -1,3 +1,4 @@
+export * from './functions';
export * from './middleware';
export * from './subscriber';
diff --git a/react/features/follow-me/middleware.js b/react/features/follow-me/middleware.js
index 609de881fd..540bba3076 100644
--- a/react/features/follow-me/middleware.js
+++ b/react/features/follow-me/middleware.js
@@ -16,6 +16,7 @@ import { setFilmstripVisible } from '../filmstrip';
import { setTileView } from '../video-layout';
import { FOLLOW_ME_COMMAND } from './constants';
+import { isFollowMeActive } from './functions';
import logger from './logger';
declare var APP: Object;
@@ -111,7 +112,7 @@ function _onFollowMeCommand(attributes = {}, id, store) {
return;
}
- if (!state['features/follow-me'].moderator) {
+ if (!isFollowMeActive(state)) {
store.dispatch(setFollowMeModerator(id));
}
diff --git a/react/features/settings/functions.js b/react/features/settings/functions.js
index 40fe09af54..4bd3a66af3 100644
--- a/react/features/settings/functions.js
+++ b/react/features/settings/functions.js
@@ -7,6 +7,7 @@ import {
getLocalParticipant,
isLocalParticipantModerator
} from '../base/participants';
+import { isFollowMeActive } from '../follow-me';
declare var interfaceConfig: Object;
@@ -85,7 +86,7 @@ export function getMoreTabProps(stateful: Object | Function) {
startAudioMutedPolicy,
startVideoMutedPolicy
} = state['features/base/conference'];
- const followMeActive = Boolean(state['features/follow-me'].moderator);
+ const followMeActive = isFollowMeActive(state);
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
// The settings sections to display.
diff --git a/react/features/video-layout/subscriber.js b/react/features/video-layout/subscriber.js
index d80ab6469a..a4c7a9a57d 100644
--- a/react/features/video-layout/subscriber.js
+++ b/react/features/video-layout/subscriber.js
@@ -11,7 +11,9 @@ import {
pinParticipant
} from '../base/participants';
import { StateListenerRegistry, equals } from '../base/redux';
+import { isFollowMeActive } from '../follow-me';
import { selectParticipant } from '../large-video';
+
import { shouldDisplayTileView } from './functions';
import { setParticipantsWithScreenShare } from './actions';
@@ -48,12 +50,11 @@ StateListenerRegistry.register(
StateListenerRegistry.register(
/* selector */ state => state['features/base/tracks'],
/* listener */ debounce((tracks, store) => {
- if (!_getAutoPinSetting()) {
+ if (!_getAutoPinSetting() || isFollowMeActive(store)) {
return;
}
- const oldScreenSharesOrder
- = store.getState()['features/video-layout'].screenShares || [];
+ const oldScreenSharesOrder = store.getState()['features/video-layout'].screenShares || [];
const knownSharingParticipantIds = tracks.reduce((acc, track) => {
if (track.mediaType === 'video' && track.videoType === 'desktop') {
const skipTrack = _getAutoPinSetting() === 'remote-only' && track.local;