mirror of
https://github.com/cline/cline.git
synced 2026-09-21 05:10:09 +08:00
Revert "Fix the case if the app state and the user state are inconsistent (#5…"
This reverts commit 922cfed632.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user