mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 00:35:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { useNotifications } from 'src/context/notifications.js'
|
||||
import { getModelDeprecationWarning } from 'src/utils/model/deprecation.js'
|
||||
import { getIsRemoteMode } from '../../bootstrap/state.js'
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useNotifications } from 'src/context/notifications.js';
|
||||
import { getModelDeprecationWarning } from 'src/utils/model/deprecation.js';
|
||||
import { getIsRemoteMode } from '../../bootstrap/state.js';
|
||||
|
||||
export function useDeprecationWarningNotification(model: string): void {
|
||||
const { addNotification } = useNotifications()
|
||||
const lastWarningRef = useRef<string | null>(null)
|
||||
const { addNotification } = useNotifications();
|
||||
const lastWarningRef = useRef<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (getIsRemoteMode()) return
|
||||
const deprecationWarning = getModelDeprecationWarning(model)
|
||||
if (getIsRemoteMode()) return;
|
||||
const deprecationWarning = getModelDeprecationWarning(model);
|
||||
|
||||
// Show warning if model is deprecated and we haven't shown this exact warning yet
|
||||
if (deprecationWarning && deprecationWarning !== lastWarningRef.current) {
|
||||
lastWarningRef.current = deprecationWarning
|
||||
lastWarningRef.current = deprecationWarning;
|
||||
addNotification({
|
||||
key: 'model-deprecation-warning',
|
||||
text: deprecationWarning,
|
||||
color: 'warning',
|
||||
priority: 'high',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// Reset tracking if model changes to non-deprecated
|
||||
if (!deprecationWarning) {
|
||||
lastWarningRef.current = null
|
||||
lastWarningRef.current = null;
|
||||
}
|
||||
}, [model, addNotification])
|
||||
}, [model, addNotification]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user