From 866dc4dbc61e660a3553298df7cfca91ba0775ac Mon Sep 17 00:00:00 2001 From: virtuacoplenny Date: Tue, 16 Apr 2019 12:27:17 -0700 Subject: [PATCH] ref(subtitles): remove logic around dialing transcriber (#4011) --- react/features/transcribing/actionTypes.js | 30 --------------- react/features/transcribing/actions.js | 45 +--------------------- react/features/transcribing/middleware.js | 34 +--------------- react/features/transcribing/reducer.js | 21 +--------- 4 files changed, 3 insertions(+), 127 deletions(-) diff --git a/react/features/transcribing/actionTypes.js b/react/features/transcribing/actionTypes.js index 97d44c5d3..df2346f44 100644 --- a/react/features/transcribing/actionTypes.js +++ b/react/features/transcribing/actionTypes.js @@ -1,23 +1,3 @@ -/** - * The type of Redux action triggering the transcriber to join (be 'dialed' in) - * - * { - * type: DIAL_TRANSCRIBER - * } - * @public - */ -export const DIAL_TRANSCRIBER = 'DIAL_TRANSCRIBER'; - -/** - * The type of Redux action triggering the transcriber to leave. - * - * { - * type: STOP_TRANSCRBIBING - * } - * @public - */ -export const STOP_TRANSCRIBING = 'STOP_TRANSCRBIBING'; - /** * The type of Redux action triggering storage of participantId of transcriber, * so that it can later be kicked @@ -53,16 +33,6 @@ export const _TRANSCRIBER_LEFT = 'TRANSCRIBER_LEFT'; export const _POTENTIAL_TRANSCRIBER_JOINED = 'POTENTIAL_TRANSCRIBER_JOINED'; -/** - * The type of a Redux action signalling that dialing the transcriber failed. - * - * { - * type: _DIAL_ERROR, - * } - * @private - */ -export const _DIAL_ERROR = 'DIAL_ERROR'; - /** * The type of Redux action which sets the pending transcribing notification UID * to use it for when hiding the notification is necessary, or unsets it when diff --git a/react/features/transcribing/actions.js b/react/features/transcribing/actions.js index 7765f6f6d..9b4c20820 100644 --- a/react/features/transcribing/actions.js +++ b/react/features/transcribing/actions.js @@ -1,13 +1,10 @@ // @flow import { - _DIAL_ERROR, _POTENTIAL_TRANSCRIBER_JOINED, _TRANSCRIBER_JOINED, _TRANSCRIBER_LEFT, - DIAL_TRANSCRIBER, - SET_PENDING_TRANSCRIBING_NOTIFICATION_UID, - STOP_TRANSCRIBING + SET_PENDING_TRANSCRIBING_NOTIFICATION_UID } from './actionTypes'; import { NOTIFICATION_TIMEOUT, @@ -16,33 +13,6 @@ import { showNotification } from '../notifications'; -/** - * Dial the transcriber into the room. - * - * @public - * @returns {{ - * type: DIAL_TRANSCRIBER - * }} - */ -export function dialTranscriber() { - return { - type: DIAL_TRANSCRIBER - }; -} - -/** - * Stop the transcribing by kicking the transcriber participant. - * - * @returns {{ - * type: STOP_TRANSCRIBING - * }} - */ -export function stopTranscribing() { - return { - type: STOP_TRANSCRIBING - }; -} - /** * Notify that the transcriber, with a unique ID, has joined. * @@ -91,19 +61,6 @@ export function potentialTranscriberJoined(participantId: string) { }; } -/** - * Notify that dialing the transcriber resulted in an error. - * - * @returns {{ - * type: _DIAL_ERROR - * }} - */ -export function dialError() { - return { - type: _DIAL_ERROR - }; -} - /** * Signals that the pending transcribing notification should be shown on the * screen. diff --git a/react/features/transcribing/middleware.js b/react/features/transcribing/middleware.js index 19e963f44..86de36b75 100644 --- a/react/features/transcribing/middleware.js +++ b/react/features/transcribing/middleware.js @@ -3,17 +3,12 @@ import { MiddlewareRegistry } from '../base/redux'; import { - _TRANSCRIBER_LEFT, - DIAL_TRANSCRIBER, - STOP_TRANSCRIBING + _TRANSCRIBER_LEFT } from './actionTypes'; import { - dialError, hidePendingTranscribingNotification, potentialTranscriberJoined, - showPendingTranscribingNotification, showStoppedTranscribingNotification, - showTranscribingError, transcriberJoined, transcriberLeft } from './actions'; @@ -23,9 +18,6 @@ import { PARTICIPANT_UPDATED } from './../base/participants'; -declare var APP: Object; - -const TRANSCRIBER_DIAL_COMMAND = 'jitsi_meet_transcribe'; const TRANSCRIBER_DISPLAY_NAME = 'Transcriber'; /** @@ -37,35 +29,11 @@ const TRANSCRIBER_DISPLAY_NAME = 'Transcriber'; // eslint-disable-next-line no-unused-vars MiddlewareRegistry.register(store => next => action => { const { - isDialing, - isTranscribing, transcriberJID, potentialTranscriberJIDs } = store.getState()['features/transcribing']; - const { conference } = store.getState()['features/base/conference']; - switch (action.type) { - case DIAL_TRANSCRIBER: - if (!(isDialing || isTranscribing)) { - store.dispatch(showPendingTranscribingNotification()); - - conference.room.dial(TRANSCRIBER_DIAL_COMMAND).catch( - () => { - store.dispatch(dialError()); - store.dispatch(hidePendingTranscribingNotification()); - store.dispatch(showTranscribingError()); - } - ); - } - break; - case STOP_TRANSCRIBING: - if (isTranscribing) { - const participant = conference.getParticipantById(transcriberJID); - - conference.room.kick(participant.getJid()); - } - break; case _TRANSCRIBER_LEFT: store.dispatch(showStoppedTranscribingNotification()); break; diff --git a/react/features/transcribing/reducer.js b/react/features/transcribing/reducer.js index 68b321d1e..e80bd2c0e 100644 --- a/react/features/transcribing/reducer.js +++ b/react/features/transcribing/reducer.js @@ -1,12 +1,9 @@ import { ReducerRegistry } from '../base/redux'; import { - _DIAL_ERROR, _TRANSCRIBER_JOINED, _TRANSCRIBER_LEFT, _POTENTIAL_TRANSCRIBER_JOINED, - DIAL_TRANSCRIBER, - SET_PENDING_TRANSCRIBING_NOTIFICATION_UID, - STOP_TRANSCRIBING + SET_PENDING_TRANSCRIBING_NOTIFICATION_UID } from '../transcribing/actionTypes'; /** @@ -66,22 +63,6 @@ function _getInitialState() { ReducerRegistry.register('features/transcribing', (state = _getInitialState(), action) => { switch (action.type) { - case DIAL_TRANSCRIBER: - return { - ...state, - isDialing: true - }; - case STOP_TRANSCRIBING: - return { - ...state, - isTerminating: true - }; - case _DIAL_ERROR: - return { - ...state, - isDialing: false, - potentialTranscriberJIDs: [] - }; case _TRANSCRIBER_JOINED: return { ...state,