mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 16:25:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import * as React from 'react'
|
||||
import type { Notification } from '../context/notifications.js'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import { logForDebugging } from '../utils/debug.js'
|
||||
import { checkAndInstallOfficialMarketplace } from '../utils/plugins/officialMarketplaceStartupCheck.js'
|
||||
import { useStartupNotification } from './notifs/useStartupNotification.js'
|
||||
import * as React from 'react';
|
||||
import type { Notification } from '../context/notifications.js';
|
||||
import { Text } from '@anthropic/ink';
|
||||
import { logForDebugging } from '../utils/debug.js';
|
||||
import { checkAndInstallOfficialMarketplace } from '../utils/plugins/officialMarketplaceStartupCheck.js';
|
||||
import { useStartupNotification } from './notifs/useStartupNotification.js';
|
||||
|
||||
/**
|
||||
* Hook that handles official marketplace auto-installation and shows
|
||||
@@ -11,49 +11,36 @@ import { useStartupNotification } from './notifs/useStartupNotification.js'
|
||||
*/
|
||||
export function useOfficialMarketplaceNotification(): void {
|
||||
useStartupNotification(async () => {
|
||||
const result = await checkAndInstallOfficialMarketplace()
|
||||
const notifs: Notification[] = []
|
||||
const result = await checkAndInstallOfficialMarketplace();
|
||||
const notifs: Notification[] = [];
|
||||
|
||||
// Check for config save failure first - this is critical
|
||||
if (result.configSaveFailed) {
|
||||
logForDebugging('Showing marketplace config save failure notification')
|
||||
logForDebugging('Showing marketplace config save failure notification');
|
||||
notifs.push({
|
||||
key: 'marketplace-config-save-failed',
|
||||
jsx: (
|
||||
<Text color="error">
|
||||
Failed to save marketplace retry info · Check ~/.claude.json
|
||||
permissions
|
||||
</Text>
|
||||
),
|
||||
jsx: <Text color="error">Failed to save marketplace retry info · Check ~/.claude.json permissions</Text>,
|
||||
priority: 'immediate',
|
||||
timeoutMs: 10000,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (result.installed) {
|
||||
logForDebugging('Showing marketplace installation success notification')
|
||||
logForDebugging('Showing marketplace installation success notification');
|
||||
notifs.push({
|
||||
key: 'marketplace-installed',
|
||||
jsx: (
|
||||
<Text color="success">
|
||||
✓ Anthropic marketplace installed · /plugin to see available plugins
|
||||
</Text>
|
||||
),
|
||||
jsx: <Text color="success">✓ Anthropic marketplace installed · /plugin to see available plugins</Text>,
|
||||
priority: 'immediate',
|
||||
timeoutMs: 7000,
|
||||
})
|
||||
});
|
||||
} else if (result.skipped && result.reason === 'unknown') {
|
||||
logForDebugging('Showing marketplace installation failure notification')
|
||||
logForDebugging('Showing marketplace installation failure notification');
|
||||
notifs.push({
|
||||
key: 'marketplace-install-failed',
|
||||
jsx: (
|
||||
<Text color="warning">
|
||||
Failed to install Anthropic marketplace · Will retry on next startup
|
||||
</Text>
|
||||
),
|
||||
jsx: <Text color="warning">Failed to install Anthropic marketplace · Will retry on next startup</Text>,
|
||||
priority: 'immediate',
|
||||
timeoutMs: 8000,
|
||||
})
|
||||
});
|
||||
}
|
||||
// Don't show notifications for:
|
||||
// - already_installed (user already has it)
|
||||
@@ -62,6 +49,6 @@ export function useOfficialMarketplaceNotification(): void {
|
||||
// - git_unavailable (marketplace is a nice-to-have; if git is missing
|
||||
// or is a non-functional macOS xcrun shim, retry silently on backoff
|
||||
// rather than nagging — the user will sort git out for other reasons)
|
||||
return notifs
|
||||
})
|
||||
return notifs;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user