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

Function applyFastMode

src/commands/fast/fast.tsx:16–40  ·  view source on GitHub ↗
(enable: boolean, setAppState: (f: (prev: AppState) => AppState) => void)

Source from the content-addressed store, hash-verified

14import { formatModelPricing, getOpus46CostTier } from '../../utils/modelCost.js';
15import { updateSettingsForSource } from '../../utils/settings/settings.js';
16function applyFastMode(enable: boolean, setAppState: (f: (prev: AppState) => AppState) => void): void {
17 clearFastModeCooldown();
18 updateSettingsForSource('userSettings', {
19 fastMode: enable ? true : undefined
20 });
21 if (enable) {
22 setAppState(prev => {
23 // Only switch model if current model doesn't support fast mode
24 const needsModelSwitch = !isFastModeSupportedByModel(prev.mainLoopModel);
25 return {
26 ...prev,
27 ...(needsModelSwitch ? {
28 mainLoopModel: getFastModeModel(),
29 mainLoopModelForSession: null
30 } : {}),
31 fastMode: true
32 };
33 });
34 } else {
35 setAppState(prev => ({
36 ...prev,
37 fastMode: false
38 }));
39 }
40}
41export function FastModePicker(t0) {
42 const $ = _c(30);
43 const {

Callers 2

FastModePickerFunction · 0.85
handleFastModeShortcutFunction · 0.85

Calls 4

clearFastModeCooldownFunction · 0.85
updateSettingsForSourceFunction · 0.85
getFastModeModelFunction · 0.85

Tested by

no test coverage detected