From 7ec52902938659738adbeb385a669f091e802850 Mon Sep 17 00:00:00 2001 From: v-darkora <134300273+v-darkora@users.noreply.github.com> Date: Fri, 28 Jul 2023 09:43:12 +0200 Subject: [PATCH] [Query Copilot] Update feature flag after sample data connection info fetch (#1560) * Update feature flag if sample data exists * Add additional conditional * Revert useknockout to starting condition * Use tracked property for rendering conditiona --- src/Explorer/SplashScreen/SplashScreen.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index 687a938a8..0253ad871 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -97,6 +97,12 @@ export class SplashScreen extends React.Component { () => this.setState({}), (state) => state.showResetPasswordBubble ), + }, + { + dispose: useDatabases.subscribe( + () => this.setState({}), + (state) => state.sampleDataResourceTokenCollection + ), } ); } @@ -107,7 +113,11 @@ export class SplashScreen extends React.Component { }; private getSplashScreenButtons = (): JSX.Element => { - if (userContext.features.enableCopilot && userContext.apiType === "SQL") { + if ( + useDatabases.getState().sampleDataResourceTokenCollection && + userContext.features.enableCopilot && + userContext.apiType === "SQL" + ) { return (