Skip to content

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

ref(api): move tile view subscriber to api dir

Leonard Kim40c16f0bace9
diff --git a/react/features/external-api/index.js b/react/features/external-api/index.js
index d436892893..eec6b85ef4 100644
--- a/react/features/external-api/index.js
+++ b/react/features/external-api/index.js
@@ -1 +1,2 @@
import './middleware';
+import './subscriber';
diff --git a/react/features/external-api/subscriber.js b/react/features/external-api/subscriber.js
new file mode 100644
index 0000000000..c07ef888c8
--- /dev/null
+++ b/react/features/external-api/subscriber.js
@@ -0,0 +1,16 @@
+// @flow
+
+import { StateListenerRegistry } from '../base/redux';
+import { shouldDisplayTileView } from '../video-layout';
+
+declare var APP: Object;
+
+/**
+ * StateListenerRegistry provides a reliable way of detecting changes to
+ * preferred layout state and dispatching additional actions.
+ */
+StateListenerRegistry.register(
+ /* selector */ state => shouldDisplayTileView(state),
+ /* listener */ displayTileView => {
+ APP.API.notifyTileViewChanged(displayTileView);
+ });
diff --git a/react/features/video-layout/subscriber.js b/react/features/video-layout/subscriber.js
index b9d8230a7a..ed0255d013 100644
--- a/react/features/video-layout/subscriber.js
+++ b/react/features/video-layout/subscriber.js
@@ -36,10 +36,6 @@ StateListenerRegistry.register(
_updateAutoPinnedParticipant(store);
}
}
-
- if (typeof APP === 'object') {
- APP.API.notifyTileViewChanged(displayTileView);
- }
}
);