Skip to content

Commit

Permalink
ZETA-6352: Remove dead code, fix double for loop. (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieGreenman authored Aug 25, 2023
1 parent c01cbe1 commit 5af4789
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
7 changes: 2 additions & 5 deletions src/update-vscode/update-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ export async function updateVsCode(context: vscode.ExtensionContext, isProductio
setWorkspaceState(context, accessToken, refreshToken, userId, orgId, isInProgress);
if(isInProgress) {
if(selectedProjects) {
for(let selectedProject of selectedProjects) {
const vsCodeInstanceId = createVSCodeIdToken(userId, orgId, selectedProject.versionControlParams, selectedProject.packageJsonParams, selectedProject.folderName);
await updatePrivateDirectoriesInVSCodeAuthentication(accessToken, isProduction, userId, orgId, selectedProjects);
await subscribeToGenerateVsCodeDownloadCodeSub({ vsCodeInstanceId, context, isProduction, selectedProjects });
}
await subscribeToGenerateVsCodeDownloadCodeSub({ context, isProduction, selectedProjects });
await updatePrivateDirectoriesInVSCodeAuthentication(accessToken, isProduction, userId, orgId, selectedProjects);
}
vscode.window.showInformationMessage('User successfully authenticated with Razroo.');
if(projectsProvider) {
Expand Down
10 changes: 1 addition & 9 deletions src/utils/graphql.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export const subscribeToGenerateVsCodeDownloadCodeSub = async ({
// enable root path even if no version control params
const path = selectedProject?.versionControlParams ? versionControlParamsPath : selectedProject?.rootPath;
await saveFiles(data?.data?.generateVsCodeDownloadCodeSub, context, isProduction, path);
// await updatePrivateDirectoriesPostCodeGeneration(context, isProduction, selectedProjects);
});
};

Expand Down Expand Up @@ -124,13 +123,6 @@ async function fallback(content) {
console.log(content);
}

async function updatePrivateDirectoriesPostCodeGeneration(context, isProduction: boolean, allPackageJsons) {
const userId = context.globalState.get(MEMENTO_RAZROO_USER_ID);
const accessToken = context.globalState.get(MEMENTO_RAZROO_ACCESS_TOKEN);
const orgId = context.globalState.get(MEMENTO_RAZROO_ORG_ID);
await updatePrivateDirectoriesInVSCodeAuthentication(accessToken, isProduction, userId, orgId, allPackageJsons);
}

async function generateVsCodeDownloadCodeSubError(data: any, context, isProduction: boolean, projectsProvider, allPackageJsons) {
let accessToken = context.globalState.get(MEMENTO_RAZROO_ACCESS_TOKEN);

Expand Down Expand Up @@ -210,7 +202,7 @@ export const updatePrivateDirectoriesRequest = async ({
});
return response?.data;
} catch (error) {
console.log('error updatePrivateDirectoriesRequest', error);
console.log('error updateVSCodeAuthentication', error);
return error;
}
};
Expand Down

0 comments on commit 5af4789

Please sign in to comment.