Skip to content

Commit

Permalink
fix: add track for save note
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 9, 2023
1 parent 824a85b commit be372de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hooks/notes/flomo.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useState } from "react";
import { useAnalytics } from '~/components/context/analytics'
import { useToast } from "~/hooks/use-toast";

export function useSaveToFlomo(note: string, webhook: string) {
const [loading, setLoading] = useState(false);
const { toast } = useToast();
const { analytics } = useAnalytics();

const save = async () => {
setLoading(true);
Expand Down Expand Up @@ -32,6 +34,7 @@ export function useSaveToFlomo(note: string, webhook: string) {
});
}
setLoading(false);
analytics.track("SaveFlomoButton Clicked");
};
return { save, loading };
}

1 comment on commit be372de

@vercel
Copy link

@vercel vercel bot commented on be372de Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.