more fixes

This commit is contained in:
Steve Faulkner
2021-01-03 23:54:37 -06:00
parent 5b6b4d3583
commit 684cbfe4a0
2 changed files with 21 additions and 17 deletions

View File

@@ -73,6 +73,8 @@ const App: React.FunctionComponent = () => {
}
}, [ref, encryptedToken, encryptedTokenMetadata, isLoggedIn, databaseAccount]);
const showAccount = (isLoggedIn && databaseAccount) || (encryptedTokenMetadata && encryptedTokenMetadata);
return (
<>
<header>
@@ -111,8 +113,7 @@ const App: React.FunctionComponent = () => {
</div>
</div>
</header>
{(isLoggedIn && databaseAccount) ||
(encryptedTokenMetadata && encryptedTokenMetadata && (
{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.
@@ -127,7 +128,7 @@ const App: React.FunctionComponent = () => {
title="explorer"
src="explorer.html?v=1.0.1&platform=Hosted"
></iframe>
))}
)}
{!isLoggedIn && !encryptedTokenMetadata && (
<ConnectExplorer {...{ login, setEncryptedToken, setAuthType, connectionString, setConnectionString }} />
)}

View File

@@ -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,