MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / handleSelect

Function handleSelect

source code/components/MessageSelector.tsx:157–178  ·  view source on GitHub ↗
(message_0: UserMessage)

Source from the content-addressed store, hash-verified

155 }
156 }
157 async function handleSelect(message_0: UserMessage) {
158 const index = messages.indexOf(message_0);
159 const indexFromEnd = messages.length - 1 - index;
160 logEvent('tengu_message_selector_selected', {
161 index_from_end: indexFromEnd,
162 message_type: message_0.type as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
163 is_current_prompt: false
164 });
165
166 // Do nothing if the message is not found
167 if (!messages.includes(message_0)) {
168 onClose();
169 return;
170 }
171 if (!isFileHistoryEnabled) {
172 await restoreConversationDirectly(message_0);
173 return;
174 }
175 const diffStats = await fileHistoryGetDiffStats(fileHistory, message_0.uuid);
176 setMessageToRestore(message_0);
177 setDiffStatsForRestore(diffStats);
178 }
179 async function onSelectRestoreOption(option: RestoreOption) {
180 logEvent('tengu_message_selector_restore_option_selected', {
181 option: option as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS

Callers 4

MessageSelectorFunction · 0.70
PermissionPromptFunction · 0.50
AddWorkspaceDirectoryFunction · 0.50
DesktopUpsellStartupFunction · 0.50

Calls 3

logEventFunction · 0.85
fileHistoryGetDiffStatsFunction · 0.85

Tested by

no test coverage detected