Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f36e5d1

Browse files
committedFeb 9, 2022
feat: update views to prevent unused network request
1 parent 8ba479a commit f36e5d1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎lib/components/title.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface DateDisplayProps {
1212
const DateDisplay: React.FC<DateDisplayProps> = ({ date }) => {
1313
const theme = useTheme()
1414
const { asPath } = useRouter()
15-
const [count, countUpdated] = useViews(asPath)
15+
const [count, countUpdated] = useViews(asPath, { disabled: !Configs.enableViews })
1616

1717
const d = useMemo(() => new Date(date), [])
1818
if (`${d}` === 'Invalid Date') return null

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@geist-ui/react": "^2.2.0",
1616
"@geist-ui/react-icons": "^1.0.1",
1717
"@geist-ui/react-prism": "^1.0.1",
18-
"@unix/views": "^0.1.3",
18+
"@unix/views": "^0.2.0",
1919
"ms": "^2.1.3",
2020
"next": "^11.1.0",
2121
"react": "^17.0.2",

‎yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,10 @@
710710
"@types/unist" "*"
711711
"@types/vfile-message" "*"
712712

713-
"@unix/views@^0.1.3":
714-
version "0.1.3"
715-
resolved "https://registry.yarnpkg.com/@unix/views/-/views-0.1.3.tgz#1cb490169b0804cffa86736d7f028faf8e0b1464"
716-
integrity sha512-KyonKxxRl0h8VHQvVfSNZdWxvVT+HmodhgkM19OkcnByVpAsKzkIfFx83vqJcNS3zCd4Z4slziYu4rPVJ3X3Vg==
713+
"@unix/views@^0.2.0":
714+
version "0.2.0"
715+
resolved "https://registry.yarnpkg.com/@unix/views/-/views-0.2.0.tgz#bad6185c5eae283967095325afdba94842e8c176"
716+
integrity sha512-Tt1EmyYfOwsnJ9GAy0Oz5SHi6Zv8/Hymgij29ASmXMlBFDpEaCaKITmoGSS7HktUUAxBBIaq1eRvva7AX0IMlQ==
717717

718718
anser@1.4.9:
719719
version "1.4.9"

0 commit comments

Comments
 (0)
Please sign in to comment.