Skip to content

Commit

Permalink
MM-56926: always allow choice of primary platform (#508)
Browse files Browse the repository at this point in the history
* MM-56926: always allow choice of primary platform

Temporarily allow users to choose their primary platform even before
connecting MS Teams, as we don't have the state needed in Redux to make
that decision.

Fixes: https://mattermost.atlassian.net/browse/MM-56926

* fix missing asset after -sync rename
  • Loading branch information
lieut-data authored Feb 21, 2024
1 parent b95ab96 commit 6f9f927
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
File renamed without changes
7 changes: 5 additions & 2 deletions webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ export default class Plugin {
registry.registerAdminConsoleCustomSetting('appManifestDownload', MSTeamsAppManifestSetting);
registry.registerAdminConsoleCustomSetting('ConnectedUsersReportDownload', ListConnectedUsers);

let settingsEnabled = (state as any)[`plugins-${manifest.id}`]?.connectedStateSlice?.connected || false; //TODO use connected selector from https://github.com/mattermost/mattermost-plugin-msteams/pull/438
// let settingsEnabled = (state as any)[`plugins-${manifest.id}`]?.connectedStateSlice?.connected || false; //TODO use connected selector from https://github.com/mattermost/mattermost-plugin-msteams/pull/438
let settingsEnabled = true;
registry.registerUserSettings?.(getSettings(serverRoute, !settingsEnabled));

this.removeStoreSubscription = store.subscribe(() => {
const newState = store.getState();
const newServerRoute = getServerRoute(newState);
const newSettingsEnabled = (newState as any)[`plugins-${manifest.id}`]?.connectedStateSlice?.connected || false; //TODO use connected selector from https://github.com/mattermost/mattermost-plugin-msteams/pull/438

// const newSettingsEnabled = (newState as any)[`plugins-${manifest.id}`]?.connectedStateSlice?.connected || false; //TODO use connected selector from https://github.com/mattermost/mattermost-plugin-msteams/pull/438
const newSettingsEnabled = true;
if (newServerRoute !== serverRoute || newSettingsEnabled !== settingsEnabled) {
serverRoute = newServerRoute;
settingsEnabled = newSettingsEnabled;
Expand Down

0 comments on commit 6f9f927

Please sign in to comment.