Skip to content

Commit

Permalink
add set_content event
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutSarac committed Sep 1, 2024
1 parent 78c0949 commit a6e66aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/store/useFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import debounce from "lodash.debounce";
import { event as gaEvent } from "nextjs-google-analytics";
import { toast } from "react-hot-toast";
import { create } from "zustand";
import { defaultJson } from "src/constants/data";
Expand Down Expand Up @@ -79,6 +80,7 @@ const useFile = create<FileStates & JsonActions>()((set, get) => ({
setFile: fileData => {
set({ fileData, format: fileData.format || FileFormat.JSON });
get().setContents({ contents: fileData.content, hasChanges: false });
gaEvent("set_content", { label: fileData.format });
},
getContents: () => get().contents,
getFormat: () => get().format,
Expand Down

0 comments on commit a6e66aa

Please sign in to comment.