From 3fc639d7b07c3b739a1b4d20beb7b23367303080 Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Fri, 15 Aug 2025 11:56:23 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"Fix=20the=20case=20if=20the=20app=20s?= =?UTF-8?q?tate=20and=20the=20user=20state=20are=20inconsistent=20(#5?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 922cfed632c2092ed5853a76ad4eb89c647b011a. --- src/core/controller/index.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/controller/index.ts b/src/core/controller/index.ts index 0e4e0b233e..883e00f94a 100644 --- a/src/core/controller/index.ts +++ b/src/core/controller/index.ts @@ -44,7 +44,6 @@ export class Controller { mcpHub: McpHub accountService: ClineAccountService - authService: AuthService readonly cacheService: CacheService constructor( @@ -56,13 +55,13 @@ export class Controller { HostProvider.get().logToChannel("ClineProvider instantiated") this.accountService = ClineAccountService.getInstance() this.cacheService = new CacheService(context) - this.authService = AuthService.getInstance(this) + const authService = AuthService.getInstance(this) // Initialize cache service asynchronously - critical for extension functionality this.cacheService .initialize() .then(() => { - this.authService.restoreRefreshTokenAndRetrieveAuthInfo() + authService.restoreRefreshTokenAndRetrieveAuthInfo() }) .catch((error) => { console.error("CRITICAL: Failed to initialize CacheService - extension may not function properly:", error) @@ -309,7 +308,7 @@ export class Controller { async handleAuthCallback(customToken: string, provider: string | null = null) { try { - await this.authService.handleAuthCallback(customToken, provider ? provider : "google") + await AuthService.getInstance(this).handleAuthCallback(customToken, provider ? provider : "google") const clineProvider: ApiProvider = "cline" @@ -595,9 +594,7 @@ export class Controller { const terminalReuseEnabled = this.cacheService.getGlobalStateKey("terminalReuseEnabled") const defaultTerminalProfile = this.cacheService.getGlobalStateKey("defaultTerminalProfile") const isNewUser = this.cacheService.getGlobalStateKey("isNewUser") - const welcomeViewCompleted = Boolean( - this.cacheService.getGlobalStateKey("welcomeViewCompleted") || this.authService.getInfo()?.user?.uid, - ) + const welcomeViewCompleted = this.cacheService.getGlobalStateKey("welcomeViewCompleted") const mcpResponsesCollapsed = this.cacheService.getGlobalStateKey("mcpResponsesCollapsed") const terminalOutputLineLimit = this.cacheService.getGlobalStateKey("terminalOutputLineLimit") const localClineRulesToggles = this.cacheService.getWorkspaceStateKey("localClineRulesToggles")