2019-04-09 11:05:20 +00:00
|
|
|
// @flow
|
|
|
|
|
2017-01-31 20:58:48 +00:00
|
|
|
import {
|
2017-02-19 00:42:11 +00:00
|
|
|
MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
|
2019-07-12 13:08:34 +00:00
|
|
|
SET_FATAL_ERROR
|
2017-01-31 20:58:48 +00:00
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
2017-02-19 00:42:11 +00:00
|
|
|
* Signals that the prompt for media permission is visible or not.
|
2017-01-31 20:58:48 +00:00
|
|
|
*
|
2017-02-19 00:42:11 +00:00
|
|
|
* @param {boolean} isVisible - If the value is true - the prompt for media
|
|
|
|
* permission is visible otherwise the value is false/undefined.
|
|
|
|
* @param {string} browser - The name of the current browser.
|
2017-05-31 05:24:34 +00:00
|
|
|
* @public
|
2017-01-31 20:58:48 +00:00
|
|
|
* @returns {{
|
2017-02-19 00:42:11 +00:00
|
|
|
* type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
|
|
|
|
* browser: {string},
|
|
|
|
* isVisible: {boolean}
|
2017-01-31 20:58:48 +00:00
|
|
|
* }}
|
|
|
|
*/
|
2019-04-09 11:05:20 +00:00
|
|
|
export function mediaPermissionPromptVisibilityChanged(isVisible: boolean, browser: string) {
|
2017-01-31 20:58:48 +00:00
|
|
|
return {
|
2017-02-19 00:42:11 +00:00
|
|
|
type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
|
|
|
|
browser,
|
|
|
|
isVisible
|
2017-01-31 20:58:48 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-06-26 12:18:29 +00:00
|
|
|
/**
|
|
|
|
* The action indicates that an unrecoverable error has occurred and the reload
|
|
|
|
* screen will be displayed or hidden.
|
|
|
|
*
|
|
|
|
* @param {Object} fatalError - A critical error which was not claimed by any
|
|
|
|
* feature for error recovery (the recoverable flag was not set). If
|
|
|
|
* {@code undefined} then any fatal error currently stored will be discarded.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_FATAL_ERROR,
|
|
|
|
* fatalError: ?Error
|
|
|
|
* }}
|
|
|
|
*/
|
2019-04-09 11:05:20 +00:00
|
|
|
export function setFatalError(fatalError: Object) {
|
2018-06-26 12:18:29 +00:00
|
|
|
return {
|
|
|
|
type: SET_FATAL_ERROR,
|
|
|
|
fatalError
|
|
|
|
};
|
|
|
|
}
|