Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisamir98 committed Feb 14, 2025
1 parent 273fefb commit 17fbfd7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/script/team/TeamRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type {
TeamMemberLeaveEvent,
} from '@wireapp/api-client/lib/event';
import {TEAM_EVENT} from '@wireapp/api-client/lib/event/TeamEvent';
import {FeatureStatus, FeatureList} from '@wireapp/api-client/lib/team/feature/';
import {FeatureStatus, FeatureList, FEATURE_KEY} from '@wireapp/api-client/lib/team/feature/';
import type {PermissionsData} from '@wireapp/api-client/lib/team/member/PermissionsData';
import type {TeamData} from '@wireapp/api-client/lib/team/team/TeamData';
import {QualifiedId} from '@wireapp/api-client/lib/user';
Expand All @@ -38,7 +38,6 @@ import {Availability} from '@wireapp/protocol-messaging';
import {WebAppEvents} from '@wireapp/webapp-events';

import {PrimaryModal} from 'Components/Modals/PrimaryModal';
import {getMLSConfig} from 'src/script/page/components/FeatureConfigChange/FeatureConfigChangeHandler/Features/MLS';
import {Environment} from 'Util/Environment';
import {t} from 'Util/LocalizerUtil';
import {getLogger, Logger} from 'Util/Logger';
Expand Down Expand Up @@ -131,7 +130,10 @@ export class TeamRepository extends TypedEventEmitter<Events> {
): Promise<{team: TeamEntity | undefined; features: FeatureList; members: QualifiedId[]}> {
const team = await this.getTeam();
// get the fresh feature config from backend
const {newFeatureList} = await this.updateFeatureConfig();
const newFeatureList = await this.teamService.getAllTeamFeatures();

this.teamState.teamFeatures(newFeatureList);

if (!teamId) {
return {team: undefined, features: {}, members: []};
}
Expand Down Expand Up @@ -159,10 +161,10 @@ export class TeamRepository extends TypedEventEmitter<Events> {

this.emit('featureConfigUpdated', {prevFeatureList, newFeatureList});

const oldMlsConfig = prevFeatureList && getMLSConfig(prevFeatureList);
const newMlsConfig = getMLSConfig(newFeatureList);

if (!oldMlsConfig && newMlsConfig) {
if (
!prevFeatureList?.[FEATURE_KEY.MLS]?.config.supportedProtocols.includes(ConversationProtocol.MLS) &&
newFeatureList?.[FEATURE_KEY.MLS]?.config.supportedProtocols.includes(ConversationProtocol.MLS)
) {
PrimaryModal.show(PrimaryModal.type.CONFIRM, {
primaryAction: {
action: () => window.location.reload(),
Expand Down

0 comments on commit 17fbfd7

Please sign in to comment.