diff --git a/vscode/webviews/components/promptList/PromptList.tsx b/vscode/webviews/components/promptList/PromptList.tsx index 284ae0aa809e..cd43e36e29dc 100644 --- a/vscode/webviews/components/promptList/PromptList.tsx +++ b/vscode/webviews/components/promptList/PromptList.tsx @@ -61,7 +61,7 @@ export const PromptList: FC = props => { const endpointURL = new URL(useConfig().authStatus.endpoint) const telemetryRecorder = useTelemetryRecorder() - const [lastUsedActions = {}] = useLocalStorage>('last-used-actions', {}) + const [lastUsedActions = {}] = useLocalStorage>('last-used-actions-v2', {}) const telemetryPublicMetadata: Record = { [`in${telemetryLocation}`]: 1, diff --git a/vscode/webviews/prompts/PromptsTab.tsx b/vscode/webviews/prompts/PromptsTab.tsx index 6cf595f532a8..4a04caf6c25e 100644 --- a/vscode/webviews/prompts/PromptsTab.tsx +++ b/vscode/webviews/prompts/PromptsTab.tsx @@ -28,15 +28,14 @@ export const PromptsTab: React.FC<{ export function useActionSelect() { const dispatchClientAction = useClientActionDispatcher() const [lastUsedActions = {}, persistValue] = useLocalStorage>( - 'last-used-actions', + 'last-used-actions-v2', {} ) return (action: Action, setView: (view: View) => void) => { try { const actionKey = action.actionType === 'prompt' ? action.id : action.key - const lastUsedActionCount = lastUsedActions[actionKey] ?? 0 - persistValue({ ...lastUsedActions, [actionKey]: lastUsedActionCount + 1 }) + persistValue({ ...lastUsedActions, [actionKey]: Date.now() }) } catch { console.error('Failed to persist last used action count') }