Skip to content

Commit

Permalink
Merge branch 'fix/bridge-recreate' into 'master'
Browse files Browse the repository at this point in the history
implement bridge recreate event

See merge request kchat/webapp!691
  • Loading branch information
antonbuks committed Mar 22, 2024
2 parents 7b5576c + 4cccbf9 commit 1fdb4f6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {RecreateMessageKey} from '@infomaniak/ksuite-bridge';
import type {AnyAction} from 'redux';
import {batchActions} from 'redux-batched-actions';

Expand Down Expand Up @@ -38,6 +39,8 @@ import type {ActionFunc, ActionResult, DispatchFunc, GetStateFunc} from 'matterm
import {getLastKSuiteSeenId} from 'mattermost-redux/utils/team_utils';
import {removeUserFromList} from 'mattermost-redux/utils/user_utils';

import {getKSuiteBridge} from 'selectors/ksuite_bridge';

import {getHistory} from 'utils/browser_history';
import {isDesktopApp} from 'utils/user_agent';

Expand Down Expand Up @@ -109,6 +112,8 @@ export function loadMeREST(): ActionFunc {

// don't redirect to the error page if it is a testing environment
if (!isDesktopApp() && Client4.isIkBaseUrl() && process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'development') { //eslint-disable-line no-process-env
const bridge = getKSuiteBridge(getState());
bridge.sendMessage({type: RecreateMessageKey, url: lastKSuiteSeen.url});
window.open(lastKSuiteSeen.url, '_self');
}

Expand Down

0 comments on commit 1fdb4f6

Please sign in to comment.