From 684cbfe4a09cb92cabbe71baaaf2b3e3230a9dfc Mon Sep 17 00:00:00 2001
From: Steve Faulkner <471400+southpolesteve@users.noreply.github.com>
Date: Sun, 3 Jan 2021 23:54:37 -0600
Subject: [PATCH] more fixes
---
src/HostedExplorer.tsx | 35 ++++++++++++++++++-----------------
src/Main.tsx | 3 +++
2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/src/HostedExplorer.tsx b/src/HostedExplorer.tsx
index 946b79720..e022d5899 100644
--- a/src/HostedExplorer.tsx
+++ b/src/HostedExplorer.tsx
@@ -73,6 +73,8 @@ const App: React.FunctionComponent = () => {
}
}, [ref, encryptedToken, encryptedTokenMetadata, isLoggedIn, databaseAccount]);
+ const showAccount = (isLoggedIn && databaseAccount) || (encryptedTokenMetadata && encryptedTokenMetadata);
+
return (
<>
@@ -111,23 +113,22 @@ const App: React.FunctionComponent = () => {
- {(isLoggedIn && databaseAccount) ||
- (encryptedTokenMetadata && encryptedTokenMetadata && (
- // Ideally we would import and render data explorer like any other React component, however
- // because it still has a significant amount of Knockout code, this would lead to memory leaks.
- // Knockout does not have a way to tear down all of its binding and listeners with a single method.
- // It's possible this can be changed once all knockout code has been removed.
-
- ))}
+ {showAccount && (
+ // Ideally we would import and render data explorer like any other React component, however
+ // because it still has a significant amount of Knockout code, this would lead to memory leaks.
+ // Knockout does not have a way to tear down all of its binding and listeners with a single method.
+ // It's possible this can be changed once all knockout code has been removed.
+
+ )}
{!isLoggedIn && !encryptedTokenMetadata && (
)}
diff --git a/src/Main.tsx b/src/Main.tsx
index 3ba187aea..c31bd652d 100644
--- a/src/Main.tsx
+++ b/src/Main.tsx
@@ -213,6 +213,9 @@ const App: React.FunctionComponent = () => {
const accountResourceId = account.id;
const subscriptionId = accountResourceId && accountResourceId.split("subscriptions/")[1].split("/")[0];
const resourceGroup = accountResourceId && accountResourceId.split("resourceGroups/")[1].split("/")[0];
+ updateUserContext({
+ databaseAccount: win.hostedConfig.databaseAccount
+ });
explorer.initDataExplorerWithFrameInputs({
databaseAccount: account,
subscriptionId,