From 145abfb026f10e205f3ddaef038fa71b7aa6191c Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 8 Mar 2022 17:11:26 +0100 Subject: [PATCH] Updated snippets --- src/constants/TelemetryEvent.ts | 1 + .../components/SnippetsView/Snippets.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/constants/TelemetryEvent.ts b/src/constants/TelemetryEvent.ts index 56a0aae5..1c1dae4b 100644 --- a/src/constants/TelemetryEvent.ts +++ b/src/constants/TelemetryEvent.ts @@ -26,4 +26,5 @@ export const TelemetryEvent = { webviewMediaView: 'webviewMediaView', webviewDataView: 'webviewDataView', webviewContentsView: 'webviewContentsView', + webviewSnippetsView: 'webviewSnippetsView', }; \ No newline at end of file diff --git a/src/dashboardWebView/components/SnippetsView/Snippets.tsx b/src/dashboardWebView/components/SnippetsView/Snippets.tsx index f794ca26..ff03bbfb 100644 --- a/src/dashboardWebView/components/SnippetsView/Snippets.tsx +++ b/src/dashboardWebView/components/SnippetsView/Snippets.tsx @@ -1,8 +1,9 @@ import { Messenger } from '@estruyf/vscode/dist/client'; import { CodeIcon, PlusSmIcon } from '@heroicons/react/outline'; import * as React from 'react'; -import { useCallback, useMemo, useState } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { useRecoilValue } from 'recoil'; +import { TelemetryEvent } from '../../../constants/TelemetryEvent'; import { DashboardMessage } from '../../DashboardMessage'; import { SettingsSelector, ViewDataSelector } from '../../state'; import { PageLayout } from '../Layout/PageLayout'; @@ -44,6 +45,12 @@ export const Snippets: React.FunctionComponent = (props: React.P setSnippetDescription(''); setSnippetBody(''); }; + + useEffect(() => { + Messenger.send(DashboardMessage.sendTelemetry, { + event: TelemetryEvent.webviewSnippetsView + }); + }, []); return (