Skip to content

Commit

Permalink
Refactor WebExtensionContext to use _connectionData instead of _entit…
Browse files Browse the repository at this point in the history
…yId in connectedUsersMap (#895)

* Refactor QuickPickProvider and WebExtensionContext to use _connectionData instead of _entityId in connectedUsersMap

* Refactor WebExtensionContext to use _connectionData instead of _entityId in connectedUsersMap

* Merge Conflict Resolved

* Fix indentation in UserData class
  • Loading branch information
ritikramuka authored Apr 9, 2024
1 parent e0c9279 commit 4ec38bc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 21 deletions.
2 changes: 0 additions & 2 deletions src/web/client/WebExtensionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,14 +776,12 @@ class WebExtensionContext implements IWebExtensionContext {
containerId: string,
userName: string,
userId: string,
entityId: string[],
connectionData: IConnectionData[],
) {
this.connectedUsers.setUserData(
containerId,
userName,
userId,
entityId,
connectionData
);
}
Expand Down
10 changes: 0 additions & 10 deletions src/web/client/common/worker/webworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,13 @@ async function loadContainer(config, swpId, entityInfo) {
.getMembers()
.get(user.userId).connections;

const userEntityIdArray = [];
const userConnectionData = [];

const connectionIdInContainer = await map
.get("selection")
.get();

userConnections.forEach((connection) => {
userEntityIdArray.push(
connectionIdInContainer.get(connection.id)
);
userConnectionData.push({ connectionId: connection.id, entityId: connectionIdInContainer.get(connection.id) });
});

Expand All @@ -139,7 +135,6 @@ async function loadContainer(config, swpId, entityInfo) {
userId: user.aadObjectId,
userName: user.userName,
containerId: swpId,
entityId: userEntityIdArray,
connectionData: userConnectionData,
});

Expand Down Expand Up @@ -180,17 +175,13 @@ async function loadContainer(config, swpId, entityInfo) {
.getMembers()
.get(user.userId).connections;

const userEntityIdArray = [];
const userConnectionData = [];

const connectionIdInContainer = await map
.get("selection")
.get();

userConnections.forEach((connection) => {
userEntityIdArray.push(
connectionIdInContainer.get(connection.id)
);
userConnectionData.push({ connectionId: connection.id, entityId: connectionIdInContainer.get(connection.id) });
});

Expand All @@ -200,7 +191,6 @@ async function loadContainer(config, swpId, entityInfo) {
userId: user.aadObjectId,
userName: user.userName,
containerId: swpId,
entityId: userEntityIdArray,
connectionData: userConnectionData,
});

Expand Down
8 changes: 0 additions & 8 deletions src/web/client/context/userDataMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class UserData implements IUserData {
_containerId: string;
_userName: string;
_userId: string;
_entityId: string[];
_connectionData: IConnectionData[];

// Getters
Expand All @@ -31,9 +30,6 @@ export class UserData implements IUserData {
public get userId(): string {
return this._userId;
}
public get entityId(): string[] {
return this._entityId;
}
public get connectionData(): IConnectionData[] {
return this._connectionData;
}
Expand All @@ -47,13 +43,11 @@ export class UserData implements IUserData {
containerId: string,
userName: string,
userId: string,
entityId: string[],
connectionData: IConnectionData[]
) {
this._containerId = containerId;
this._userName = userName;
this._userId = userId;
this._entityId = entityId;
this._connectionData = connectionData;
}
}
Expand All @@ -69,14 +63,12 @@ export class UserDataMap {
containerId: string,
userName: string,
userId: string,
entityId: string[],
connectionData: IConnectionData[]
) {
const userData = new UserData(
containerId,
userName,
userId,
entityId,
connectionData
);

Expand Down
1 change: 0 additions & 1 deletion src/web/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ export function createWebWorkerInstance(
data.containerId,
data.userName,
data.userId,
data.entityId,
data.connectionData
);
WebExtensionContext.userCollaborationProvider.refresh();
Expand Down

0 comments on commit 4ec38bc

Please sign in to comment.