Skip to content

Commit

Permalink
send opened recipy to telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jan 29, 2024
1 parent 4cada1c commit 97afe78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/frontend/src/pages/Recipe.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { getDisplayName } from '/@/utils/versionControlUtils';
import { getIcon } from '/@/utils/categoriesUtils';
import RecipeModels from './RecipeModels.svelte';
import { catalog } from '/@/stores/catalog';
import { recipes } from '/@/stores/recipe';
import { recipes } from '/@/stores/recipe';
import type { Recipe } from '@shared/src/models/IRecipe';
export let recipeId: string;
Expand All @@ -23,6 +24,13 @@ $: recipe = $catalog.recipes.find(r => r.id === recipeId);
$: categories = $catalog.categories;
$: recipeStatus = $recipes.get(recipeId);
// Send recipe info to telemetry
let recipeTelemetry: string | undefined = undefined;
$: if (recipe && recipe.id !== recipeTelemetry) {
recipeTelemetry = recipe.id;
studioClient.telemetryLogUsage('recipy.open', { 'recipe.id': recipe.id, 'recipe.name': recipe.name });
}
let loading: boolean = false;
const onPullingRequest = async () => {
loading = true;
Expand Down

0 comments on commit 97afe78

Please sign in to comment.