File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 11import { enableMapSet } from 'immer'
22
3+ import {
4+ getClaudeOAuthCredentials ,
5+ getValidClaudeOAuthCredentials ,
6+ } from '@codebuff/sdk'
7+
38import { initializeThemeStore } from '../hooks/use-theme'
49import { setProjectRoot } from '../project-files'
510import { initTimestampFormatter } from '../utils/helpers'
611import { enableManualThemeRefresh } from '../utils/theme-system'
712
8- export async function initializeApp ( params : {
9- cwd ?: string
10- } ) : Promise < void > {
13+ export async function initializeApp ( params : { cwd ?: string } ) : Promise < void > {
1114 if ( params . cwd ) {
1215 process . chdir ( params . cwd )
1316 }
@@ -18,4 +21,13 @@ export async function initializeApp(params: {
1821 initializeThemeStore ( )
1922 enableManualThemeRefresh ( )
2023 initTimestampFormatter ( )
24+
25+ // Refresh Claude OAuth credentials in the background if they exist
26+ // This ensures the subscription status is up-to-date on startup
27+ const claudeCredentials = getClaudeOAuthCredentials ( )
28+ if ( claudeCredentials ) {
29+ void getValidClaudeOAuthCredentials ( ) . catch ( ( ) => {
30+ // Silently ignore refresh errors - will be retried on next API call
31+ } )
32+ }
2133}
You can’t perform that action at this time.
0 commit comments