Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: remove logEvent calls from additional components

yoginth.com a97805c2 e31a17d4

verified
-28
-2
apps/web/src/components/Shared/Alert/DeletePost.tsx
··· 5 5 import { toast } from "sonner"; 6 6 import { Alert } from "@/components/Shared/UI"; 7 7 import errorToast from "@/helpers/errorToast"; 8 - import logEvent from "@/helpers/logEvent"; 9 8 import useTransactionLifecycle from "@/hooks/useTransactionLifecycle"; 10 9 import { useDeletePostAlertStore } from "@/store/non-persisted/alert/useDeletePostAlertStore"; 11 10 ··· 25 24 setShowPostDeleteAlert(false); 26 25 updateCache(); 27 26 toast.success("Post deleted"); 28 - void logEvent("Delete Post"); 29 27 }; 30 28 31 29 const onError = useCallback((error: ApolloClientError) => {
-2
apps/web/src/components/Shared/Group/CancelGroupMembershipRequest.tsx
··· 8 8 import { toast } from "sonner"; 9 9 import { Button } from "@/components/Shared/UI"; 10 10 import errorToast from "@/helpers/errorToast"; 11 - import logEvent from "@/helpers/logEvent"; 12 11 import useTransactionLifecycle from "@/hooks/useTransactionLifecycle"; 13 12 14 13 interface CancelGroupMembershipRequestProps { ··· 39 38 updateCache(); 40 39 setIsSubmitting(false); 41 40 toast.success("Request cancelled"); 42 - void logEvent("Cancel Group Request"); 43 41 }; 44 42 45 43 const onError = useCallback((error: ApolloClientError) => {
-5
apps/web/src/components/Shared/Group/Join.tsx
··· 9 9 import { toast } from "sonner"; 10 10 import { Button } from "@/components/Shared/UI"; 11 11 import errorToast from "@/helpers/errorToast"; 12 - import logEvent from "@/helpers/logEvent"; 13 12 import useTransactionLifecycle from "@/hooks/useTransactionLifecycle"; 14 13 15 14 interface JoinProps { ··· 45 44 }; 46 45 47 46 const onCompleted = () => { 48 - const eventName = group.membershipApprovalEnabled 49 - ? "Request Group Membership" 50 - : "Join Group"; 51 47 updateCache(); 52 48 setIsSubmitting(false); 53 49 onSuccess?.(); 54 50 toast.success( 55 51 group.membershipApprovalEnabled ? "Request sent" : "Joined group" 56 52 ); 57 - void logEvent(eventName); 58 53 }; 59 54 60 55 const onError = useCallback((error: ApolloClientError) => {
-2
apps/web/src/components/Shared/Group/Leave.tsx
··· 5 5 import { toast } from "sonner"; 6 6 import { Button } from "@/components/Shared/UI"; 7 7 import errorToast from "@/helpers/errorToast"; 8 - import logEvent from "@/helpers/logEvent"; 9 8 import useTransactionLifecycle from "@/hooks/useTransactionLifecycle"; 10 9 11 10 interface LeaveProps { ··· 33 32 updateCache(); 34 33 setIsSubmitting(false); 35 34 toast.success("Left group"); 36 - void logEvent("Leave Group"); 37 35 }; 38 36 39 37 const onError = useCallback((error: ApolloClientError) => {
-3
apps/web/src/components/Shared/Modal/ReportAccount/index.tsx
··· 19 19 } from "@/components/Shared/UI"; 20 20 import convertToTitleCase from "@/helpers/convertToTitleCase"; 21 21 import errorToast from "@/helpers/errorToast"; 22 - import logEvent from "@/helpers/logEvent"; 23 22 import stopEventPropagation from "@/helpers/stopEventPropagation"; 24 23 25 24 const ValidationSchema = z.object({ ··· 55 54 } 56 55 } 57 56 }); 58 - 59 - void logEvent("Report Account"); 60 57 61 58 return response; 62 59 };
-6
apps/web/src/components/Shared/Post/ContentFeedType.tsx
··· 2 2 import type { Dispatch, SetStateAction } from "react"; 3 3 import { memo } from "react"; 4 4 import { Tabs } from "@/components/Shared/UI"; 5 - import logEvent from "@/helpers/logEvent"; 6 5 7 6 interface ContentFeedTypeProps { 8 7 focus?: MainContentFocus; ··· 30 29 layoutId={layoutId} 31 30 setActive={(type) => { 32 31 setFocus(type as MainContentFocus); 33 - const tab = tabs.find((tabItem) => tabItem.type === type); 34 - if (tab) { 35 - const context = layoutId.replace(/_/g, " "); 36 - void logEvent(`${context} Tab: ${tab.name}`); 37 - } 38 32 }} 39 33 tabs={tabs} 40 34 />
-2
apps/web/src/components/Shared/Search/index.tsx
··· 16 16 import Loader from "@/components/Shared/Loader"; 17 17 import { Card, Form, Input, useZodForm } from "@/components/Shared/UI"; 18 18 import cn from "@/helpers/cn"; 19 - import logEvent from "@/helpers/logEvent"; 20 19 import { useAccountLinkStore } from "@/store/non-persisted/navigation/useAccountLinkStore"; 21 20 import { useSearchStore } from "@/store/persisted/useSearchStore"; 22 21 import RecentAccounts from "./RecentAccounts"; ··· 71 70 } else { 72 71 navigate(`/search?q=${encodeURIComponent(search)}&type=accounts`); 73 72 } 74 - void logEvent("Search"); 75 73 handleReset(); 76 74 }, 77 75 [pathname, navigate, type, handleReset]
-2
apps/web/src/hooks/useCopyToClipboard.tsx
··· 1 1 import { useCallback } from "react"; 2 2 import { toast } from "sonner"; 3 - import logEvent from "@/helpers/logEvent"; 4 3 5 4 const useCopyToClipboard = ( 6 5 text: string, ··· 15 14 16 15 await navigator.clipboard.writeText(text); 17 16 toast.success(successMessage); 18 - void logEvent("Copy to Clipboard"); 19 17 } catch { 20 18 toast.error(errorMessage); 21 19 }
-2
apps/web/src/hooks/useCreatePost.tsx
··· 10 10 import { useNavigate } from "react-router"; 11 11 import { toast } from "sonner"; 12 12 import { hono } from "@/helpers/fetcher"; 13 - import logEvent from "@/helpers/logEvent"; 14 13 import useTransactionLifecycle from "./useTransactionLifecycle"; 15 14 import useWaitForTransactionToComplete from "./useWaitForTransactionToComplete"; 16 15 ··· 46 45 const type = isComment ? "Comment" : "Post"; 47 46 48 47 void hono.posts.create({ slug: data.post.slug, type }); 49 - void logEvent(type); 50 48 51 49 toast.success(`${type} created successfully!`, { 52 50 action: {
-2
apps/web/src/hooks/useEditPost.tsx
··· 3 3 import type { ApolloClientError } from "@hey/types/errors"; 4 4 import { useCallback } from "react"; 5 5 import { toast } from "sonner"; 6 - import logEvent from "@/helpers/logEvent"; 7 6 import { usePostStore } from "@/store/non-persisted/post/usePostStore"; 8 7 import useTransactionLifecycle from "./useTransactionLifecycle"; 9 8 import useWaitForTransactionToComplete from "./useWaitForTransactionToComplete"; ··· 33 32 34 33 setEditingPost(undefined); 35 34 toast.success("Post edited successfully!", { id: toastId }); 36 - void logEvent("Edit Post"); 37 35 cache.modify({ 38 36 fields: { post: () => data.post }, 39 37 id: cache.identify(data.post)