From 2740657b4a16f4af9bb0f33b269392350bf9b612 Mon Sep 17 00:00:00 2001 From: Senthamil Sindhu Date: Mon, 8 Jul 2024 14:39:49 -0700 Subject: [PATCH] Remove unnecessary code --- src/Common/CosmosClient.ts | 2 +- src/Common/MongoProxyClient.ts | 1 - src/hooks/useKnockoutExplorer.ts | 12 ++++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Common/CosmosClient.ts b/src/Common/CosmosClient.ts index 0d1d97996..82c09b59d 100644 --- a/src/Common/CosmosClient.ts +++ b/src/Common/CosmosClient.ts @@ -32,7 +32,7 @@ export const tokenProvider = async (requestInfo: Cosmos.RequestInfo) => { console.log(`Returning Auth token`); return authorizationToken; } - + if (configContext.platform === Platform.Emulator) { // TODO This SDK method mutates the headers object. Find a better one or fix the SDK. await Cosmos.setAuthorizationTokenHeaderUsingMasterKey(verb, resourceId, resourceType, headers, EmulatorMasterKey); diff --git a/src/Common/MongoProxyClient.ts b/src/Common/MongoProxyClient.ts index 860be2bee..d9aa0fb4c 100644 --- a/src/Common/MongoProxyClient.ts +++ b/src/Common/MongoProxyClient.ts @@ -710,4 +710,3 @@ async function errorHandling(response: Response, action: string, params: unknown export function getARMCreateCollectionEndpoint(params: DataModels.MongoParameters): string { return `subscriptions/${params.sid}/resourceGroups/${params.rg}/providers/Microsoft.DocumentDB/databaseAccounts/${userContext.databaseAccount.name}/mongodbDatabases/${params.db}/collections/${params.coll}`; } - diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 42247f72c..e3dafc99e 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -440,10 +440,9 @@ async function configurePortal(): Promise { updateUserContext({ authType: AuthType.AAD, }); - - + let explorer: Explorer; - return new Promise(async (resolve) => { + return new Promise((resolve) => { // In development mode, try to load the iframe message from session storage. // This allows webpack hot reload to function properly in the portal if (process.env.NODE_ENV === "development" && !window.location.search.includes("disablePortalInitCache")) { @@ -457,7 +456,6 @@ async function configurePortal(): Promise { updateContextsFromPortalMessage(message); explorer = new Explorer(); - // In development mode, save the iframe message from the portal in session storage. // This allows webpack hot reload to funciton properly if (process.env.NODE_ENV === "development") { @@ -481,7 +479,7 @@ async function configurePortal(): Promise { // Check for init message const message: PortalMessage = event.data?.data; - const inputs = message?.inputs; + const inputs = message?.inputs; const openAction = message?.openAction; if (inputs) { if ( @@ -553,11 +551,9 @@ async function configurePortal(): Promise { }, false, ); - + sendReadyMessage(); - }); - } function shouldForwardMessage(message: PortalMessage, messageOrigin: string) {