Skip to content

Commit

Permalink
[MM-57327] Set basename on default client as well if present (#663)
Browse files Browse the repository at this point in the history
* Set basename on default client as well if present

* Fix import order
  • Loading branch information
streamer45 authored Mar 21, 2024
1 parent 5c69355 commit 00b3634
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions standalone/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import {WebSocketMessage} from '@mattermost/client/websocket';
import type {DesktopAPI} from '@mattermost/desktop-api';
import {setServerVersion} from 'mattermost-redux/actions/general';
import {Client4} from 'mattermost-redux/client';
import {getChannel} from 'mattermost-redux/selectors/entities/channels';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getTheme, Theme} from 'mattermost-redux/selectors/entities/preferences';
Expand Down Expand Up @@ -162,7 +163,11 @@ export default async function init(cfg: InitConfig) {

// Setting the base URL if present, in case MM is running under a subpath.
if (window.basename) {
// If present, we need to set the basename on both the client we use (RestClient)
// and the default one (Client4) used by internal Redux actions. Not doing so
// would break Calls widget on installations served under a subpath.
RestClient.setUrl(window.basename);
Client4.setUrl(window.basename);
}
RestClient.setToken(getToken());

Expand Down

0 comments on commit 00b3634

Please sign in to comment.