Skip to content

Commit

Permalink
Merge branch 'main' into users/ramukaritik/people-on-the-site-tree-we…
Browse files Browse the repository at this point in the history
…bview
  • Loading branch information
ritikramuka authored Dec 8, 2023
2 parents 5f5617c + 323293b commit ff642b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/web/client/common/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IAttributePath {
export interface IEntityInfo {
entityId: string;
entityName: string;
rootWebPageId?: string;
}

export interface IFileInfo {
Expand Down
8 changes: 7 additions & 1 deletion src/web/client/common/worker/webworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ async function loadContainer(config, swpId, entityInfo) {

const existingMembers = audience.getMembers();

// TODO: yet to be decided how entity id will be passed in container from vscode side
const myself = audience.getMyself();

if (audience && myself) {
const myConnectionId = audience['container'].clientId;
const entityIdObj = new Array(entityInfo.rootWebPageId);
(await container.initialObjects.sharedState.get('selection').get()).set(myConnectionId, entityIdObj);
}

audience.on("memberRemoved", (clientId, member) => {
if (!existingMembers.get(member.userId)) {
Expand Down
3 changes: 2 additions & 1 deletion src/web/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ export function processWorkspaceStateChanges(context: vscode.ExtensionContext) {
const document = tab.input;
const entityInfo: IEntityInfo = {
entityId: getFileEntityId(document.uri.fsPath),
entityName: getFileEntityName(document.uri.fsPath)
entityName: getFileEntityName(document.uri.fsPath),
rootWebPageId: WebExtensionContext.entityDataMap.getEntityMap.get(getFileEntityId(document.uri.fsPath))?.rootWebPageId as string
};
if (entityInfo.entityId && entityInfo.entityName) {
context.workspaceState.update(document.uri.fsPath, entityInfo);
Expand Down

0 comments on commit ff642b1

Please sign in to comment.