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

Function SessionBackgroundHint

src/components/SessionBackgroundHint.tsx:27–100  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

25 * 2. No foreground tasks (bash/agent) are running (those take priority for Ctrl+B)
26 */
27export function SessionBackgroundHint(t0) {
28 const $ = _c(10);
29 const {
30 onBackgroundSession,
31 isLoading
32 } = t0;
33 const setAppState = useSetAppState();
34 const appStateStore = useAppStateStore();
35 const [showSessionHint, setShowSessionHint] = useState(false);
36 const handleDoublePress = useDoublePress(setShowSessionHint, onBackgroundSession, _temp);
37 let t1;
38 if ($[0] !== appStateStore || $[1] !== handleDoublePress || $[2] !== isLoading || $[3] !== setAppState) {
39 t1 = () => {
40 if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS)) {
41 return;
42 }
43 const state = appStateStore.getState();
44 if (hasForegroundTasks(state)) {
45 backgroundAll(() => appStateStore.getState(), setAppState);
46 if (!getGlobalConfig().hasUsedBackgroundTask) {
47 saveGlobalConfig(_temp2);
48 }
49 } else {
50 if (isEnvTruthy("false") && isLoading) {
51 handleDoublePress();
52 }
53 }
54 };
55 $[0] = appStateStore;
56 $[1] = handleDoublePress;
57 $[2] = isLoading;
58 $[3] = setAppState;
59 $[4] = t1;
60 } else {
61 t1 = $[4];
62 }
63 const handleBackground = t1;
64 const hasForeground = useAppState(hasForegroundTasks);
65 let t2;
66 if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
67 t2 = isEnvTruthy("false");
68 $[5] = t2;
69 } else {
70 t2 = $[5];
71 }
72 const sessionBgEnabled = t2;
73 const t3 = hasForeground || sessionBgEnabled && isLoading;
74 let t4;
75 if ($[6] !== t3) {
76 t4 = {
77 context: "Task",
78 isActive: t3
79 };
80 $[6] = t3;
81 $[7] = t4;
82 } else {
83 t4 = $[7];
84 }

Callers

nothing calls this directly

Calls 11

useSetAppStateFunction · 0.85
useAppStateStoreFunction · 0.85
useDoublePressFunction · 0.85
isEnvTruthyFunction · 0.85
hasForegroundTasksFunction · 0.85
backgroundAllFunction · 0.85
getGlobalConfigFunction · 0.85
saveGlobalConfigFunction · 0.85
useAppStateFunction · 0.85
useKeybindingFunction · 0.85
useShortcutDisplayFunction · 0.85

Tested by

no test coverage detected