MCPcopy
hub / github.com/codeaashu/claude-code / useSettingsErrors

Function useSettingsErrors

src/hooks/notifs/useSettingsErrors.tsx:9–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { useSettingsChange } from '../useSettingsChange.js';
8const SETTINGS_ERRORS_NOTIFICATION_KEY = 'settings-errors';
9export function useSettingsErrors() {
10 const $ = _c(6);
11 const {
12 addNotification,
13 removeNotification
14 } = useNotifications();
15 const [errors_0, setErrors] = useState(_temp);
16 let t0;
17 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
18 t0 = () => {
19 const {
20 errors: errors_1
21 } = getSettingsWithAllErrors();
22 setErrors(errors_1);
23 };
24 $[0] = t0;
25 } else {
26 t0 = $[0];
27 }
28 const handleSettingsChange = t0;
29 useSettingsChange(handleSettingsChange);
30 let t1;
31 let t2;
32 if ($[1] !== addNotification || $[2] !== errors_0 || $[3] !== removeNotification) {
33 t1 = () => {
34 if (getIsRemoteMode()) {
35 return;
36 }
37 if (errors_0.length > 0) {
38 const message = `Found ${errors_0.length} settings ${errors_0.length === 1 ? "issue" : "issues"} · /doctor for details`;
39 addNotification({
40 key: SETTINGS_ERRORS_NOTIFICATION_KEY,
41 text: message,
42 color: "warning",
43 priority: "high",
44 timeoutMs: 60000
45 });
46 } else {
47 removeNotification(SETTINGS_ERRORS_NOTIFICATION_KEY);
48 }
49 };
50 t2 = [errors_0, addNotification, removeNotification];
51 $[1] = addNotification;
52 $[2] = errors_0;
53 $[3] = removeNotification;
54 $[4] = t1;
55 $[5] = t2;
56 } else {
57 t1 = $[4];
58 t2 = $[5];
59 }
60 useEffect(t1, t2);
61 return errors_0;
62}
63function _temp() {
64 const {
65 errors

Callers 2

REPLFunction · 0.85
DoctorFunction · 0.85

Calls 4

getSettingsWithAllErrorsFunction · 0.85
useSettingsChangeFunction · 0.85
getIsRemoteModeFunction · 0.85
useNotificationsFunction · 0.50

Tested by

no test coverage detected