2020-06-04 14:09:13 +00:00
|
|
|
import { appNavigate } from '../app/actions';
|
2022-11-10 08:45:56 +00:00
|
|
|
import { IStore } from '../app/types';
|
2021-04-22 15:05:14 +00:00
|
|
|
import { conferenceLeft } from '../base/conference/actions';
|
2021-03-24 14:09:40 +00:00
|
|
|
import { connectionFailed } from '../base/connection/actions.native';
|
2022-11-10 08:45:56 +00:00
|
|
|
import { set } from '../base/redux/functions';
|
2017-09-18 07:09:43 +00:00
|
|
|
|
2021-04-22 15:05:14 +00:00
|
|
|
import { CANCEL_LOGIN } from './actionTypes';
|
|
|
|
import { stopWaitForOwner } from './actions.any';
|
2017-09-18 07:09:43 +00:00
|
|
|
|
2021-04-22 15:05:14 +00:00
|
|
|
export * from './actions.any';
|
2017-09-08 13:36:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels {@ink LoginDialog}.
|
|
|
|
*
|
|
|
|
* @returns {{
|
2017-09-18 07:09:43 +00:00
|
|
|
* type: CANCEL_LOGIN
|
2017-09-08 13:36:42 +00:00
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function cancelLogin() {
|
2022-11-10 08:45:56 +00:00
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
2018-05-01 19:58:46 +00:00
|
|
|
dispatch({ type: CANCEL_LOGIN });
|
|
|
|
|
|
|
|
// XXX The error associated with CONNECTION_FAILED was marked as
|
|
|
|
// recoverable by the authentication feature and, consequently,
|
|
|
|
// recoverable-aware features such as mobile's external-api did not
|
|
|
|
// deliver the CONFERENCE_FAILED to the SDK clients/consumers (as
|
|
|
|
// a reaction to CONNECTION_FAILED). Since the
|
|
|
|
// app/user is going to navigate to WelcomePage, the SDK
|
|
|
|
// clients/consumers need an event.
|
|
|
|
const { error, passwordRequired }
|
|
|
|
= getState()['features/base/connection'];
|
2017-11-17 19:06:47 +00:00
|
|
|
|
2018-05-01 19:58:46 +00:00
|
|
|
passwordRequired
|
|
|
|
&& dispatch(
|
|
|
|
connectionFailed(
|
2022-11-10 08:45:56 +00:00
|
|
|
passwordRequired, // @ts-ignore
|
|
|
|
set(error, 'recoverable', false) as any));
|
2017-09-08 13:36:42 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels {@link WaitForOwnerDialog}. Will navigate back to the welcome page.
|
|
|
|
*
|
2017-10-06 20:15:51 +00:00
|
|
|
* @returns {Function}
|
2017-09-08 13:36:42 +00:00
|
|
|
*/
|
|
|
|
export function cancelWaitForOwner() {
|
2022-11-10 08:45:56 +00:00
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
2017-10-06 20:15:51 +00:00
|
|
|
dispatch(stopWaitForOwner());
|
2017-10-24 18:58:08 +00:00
|
|
|
|
|
|
|
// XXX The error associated with CONFERENCE_FAILED was marked as
|
|
|
|
// recoverable by the feature room-lock and, consequently,
|
|
|
|
// recoverable-aware features such as mobile's external-api did not
|
|
|
|
// deliver the CONFERENCE_FAILED to the SDK clients/consumers. Since the
|
|
|
|
// app/user is going to nativate to WelcomePage, the SDK
|
|
|
|
// clients/consumers need an event.
|
2017-10-20 17:53:10 +00:00
|
|
|
const { authRequired } = getState()['features/base/conference'];
|
|
|
|
|
2017-10-24 18:58:08 +00:00
|
|
|
authRequired && dispatch(conferenceLeft(authRequired));
|
2017-10-20 17:53:10 +00:00
|
|
|
|
2017-10-06 20:15:51 +00:00
|
|
|
dispatch(appNavigate(undefined));
|
2017-09-08 13:36:42 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|