diff --git a/context/file-system-context.tsx b/context/file-system-context.tsx index d8e96b4..e2f2b5c 100644 --- a/context/file-system-context.tsx +++ b/context/file-system-context.tsx @@ -69,7 +69,6 @@ export function FileSystemProvider({children}: { children: React.ReactNode }) { } const openFile = (file: File) => { - trackEvent(EventType.FILE_OPEN, file.id) setActiveFileId(file.id) setOpenFiles((prev) => { if (!prev.find((f) => f.id === file.id)) { @@ -77,6 +76,10 @@ export function FileSystemProvider({children}: { children: React.ReactNode }) { } return prev }) + // Log only if the file is not active to avoid duplicate events when re-opening the same file + if (activeFileId !== file.id) { + trackEvent(EventType.FILE_OPEN, file.id) + } } const openFileById = (fileId: string) => { diff --git a/package.json b/package.json index 8ea4b17..536ac5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "portfolio", - "version": "0.4.0", + "version": "0.4.1", "private": true, "scripts": { "dev": "next dev", diff --git a/public/images/portfolio-overview.png b/public/images/portfolio-overview.png index 8a3cd50..6743e8a 100644 Binary files a/public/images/portfolio-overview.png and b/public/images/portfolio-overview.png differ