Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixes leaving the visitor's meeting on promotion. #14239

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions react/features/base/conference/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,6 @@ export function setAssumedBandwidthBps(assumedBandwidthBps: number) {
*/
export function redirect(vnode: string, focusJid: string, username: string) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const { conference, joining } = getState()['features/base/conference'];
const currentConference = conference || joining;
const newConfig = getVisitorOptions(getState, vnode, focusJid, username);

if (!newConfig) {
Expand All @@ -1011,8 +1009,7 @@ export function redirect(vnode: string, focusJid: string, username: string) {
}

dispatch(overwriteConfig(newConfig)) // @ts-ignore
.then(() => currentConference && dispatch(conferenceWillLeave(currentConference, true)))
.then(() => dispatch(disconnect()))
.then(() => dispatch(disconnect(true)))
.then(() => dispatch(setIAmVisitor(Boolean(vnode))))

// we do not clear local tracks on error, so we need to manually clear them
Expand Down
6 changes: 4 additions & 2 deletions react/features/base/connection/actions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,11 @@ function _connectionWillConnect(connection: Object) {
/**
* Closes connection.
*
* @param {boolean} isRedirect - Indicates if the action has been dispatched as part of visitor promotion.
*
* @returns {Function}
*/
export function disconnect() {
export function disconnect(isRedirect?: boolean) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']): Promise<void> => {
const state = getState();

Expand All @@ -348,7 +350,7 @@ export function disconnect() {
// (and the respective Redux action) which is fired after the
// conference has been left, notify the application about the
// intention to leave the conference.
dispatch(conferenceWillLeave(conference_));
dispatch(conferenceWillLeave(conference_, isRedirect));

promise
= conference_.leave()
Expand Down