forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from janeapp/waiting-area-rn
[TEL-281] Telehealth waiting area/ practitioner tool (ios)
- Loading branch information
Showing
29 changed files
with
1,158 additions
and
38 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import _ from 'lodash'; | ||
|
||
import jwtDecode from 'jwt-decode'; | ||
import { JitsiTrackErrors } from '../lib-jitsi-meet'; | ||
import { | ||
getLocalParticipant, | ||
|
@@ -351,3 +352,23 @@ export function sendLocalParticipant( | |
|
||
conference.setDisplayName(name); | ||
} | ||
|
||
/** | ||
* Check if the call is the test call. | ||
* | ||
* | ||
* @param {Function|Object} state - The redux store, state, or | ||
* {@code getState} function. | ||
* @returns {boolean} | ||
*/ | ||
export function isJaneTestCall(state) { | ||
const { jwt } = state['features/base/jwt']; | ||
const jwtPayload = jwt && jwtDecode(jwt) ?? null; | ||
const context = jwtPayload && jwtPayload.context ?? null; | ||
const user = context && context.user ?? null; | ||
const participantId = user && user.participant_id; | ||
const videoChatSessionId = context && context.video_chat_session_id; | ||
const participantEmail = user && user.email; | ||
|
||
return participantId === 0 && videoChatSessionId === 0 && participantEmail === '[email protected]'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// @flow | ||
|
||
import { | ||
checkLocalParticipantCanJoin, | ||
isJaneWaitingAreaEnabled | ||
} from '../../../jane-waiting-area-native/functions'; | ||
import { getLocalParticipantType } from '../../participants/functions'; | ||
|
||
/** | ||
* Returns the field value in a platform generic way. | ||
* | ||
* @param {Object | string} fieldParameter - The parameter passed through the change event function. | ||
* @returns {string} | ||
*/ | ||
export function getFieldValue(fieldParameter: Object | string) { | ||
return typeof fieldParameter === 'string' ? fieldParameter : fieldParameter?.target?.value; | ||
} | ||
|
||
// eslint-disable-next-line require-jsdoc | ||
export function shouldShowPreCallMessage(state: Object) { | ||
const participantType = getLocalParticipantType(state); | ||
const { remoteParticipantsStatuses } = state['features/jane-waiting-area-native']; | ||
|
||
if (isJaneWaitingAreaEnabled(state)) { | ||
return participantType !== 'StaffMember' | ||
&& !checkLocalParticipantCanJoin(remoteParticipantsStatuses, participantType); | ||
} | ||
|
||
return true; | ||
} |
Oops, something went wrong.