Skip to content

Commit

Permalink
Disable counting of clicks in Firefox (see #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Mar 6, 2021
1 parent 58de2c3 commit 5a874fd
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/components/bookmark-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ export function BookmarkItem({
);

const openBookmark = useCallback(() => {
gistStore.updateFile?.(
filename,
serializeBookmark({
...bookmark,
mtime: Date.now(),
clickCount: (bookmark.clickCount ?? 0) + 1,
}),
true
);
if (!window.navigator.userAgent.includes('Firefox')) {
gistStore.updateFile?.(
filename,
serializeBookmark({
...bookmark,
mtime: Date.now(),
clickCount: (bookmark.clickCount ?? 0) + 1,
}),
true
);
}

window.location.href = bookmark.url;
}, [filename, bookmark]);
Expand Down

0 comments on commit 5a874fd

Please sign in to comment.