fix(telemetry): review nits
- dock h2h source corrected to match_dock; badge_viewed breakdown via value - stats filter guards unified, ref-based, double-tap safe - emoji picker reuses handleReactionClick; comment and import tidy
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Box, Stack, Text, Divider, Group, Button } from "@mantine/core";
|
||||
import { Suspense, useState, useDeferredValue } from "react";
|
||||
import { Suspense, useState, useDeferredValue, useRef } from "react";
|
||||
import { Trans, useLingui } from "@lingui/react/macro";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import Header from "./header";
|
||||
@@ -21,8 +21,10 @@ const StatsWithFilter = ({ id }: { id: string }) => {
|
||||
const deferredViewType = useDeferredValue(viewType);
|
||||
const isStale = viewType !== deferredViewType;
|
||||
|
||||
const viewTypeRef = useRef(viewType);
|
||||
const changeViewType = (next: typeof viewType) => {
|
||||
if (next === viewType) return;
|
||||
if (viewTypeRef.current === next) return;
|
||||
viewTypeRef.current = next;
|
||||
track("stats_filtered", { value: next, source: "profile" });
|
||||
setViewType(next);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user