Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => {

const navigateEntry = useNavigateEntry()

const hideRecentReader = useUISettingKey("hideRecentReader")

if (!entry) return null

return compact ? (
Expand Down Expand Up @@ -132,7 +134,7 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => {
(entryHistory?.readCount ?? 0) +
(entryHistory?.userIds?.every((id) => id !== user?.id) ? 1 : 0)

return readCount > 0 ? (
return readCount > 0 && !hideRecentReader ? (
<div className="flex items-center gap-1.5">
<i className="i-mgc-eye-2-cute-re text-base" />
<span className="text-xs tabular-nums">{readCount.toLocaleString()}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FeedViewType } from "@follow/constants"
import { useEntry, usePrefetchEntryDetail } from "@follow/store/entry/hooks"
import { useEntry, useEntryReadHistory, usePrefetchEntryDetail } from "@follow/store/entry/hooks"
import { entrySyncServices } from "@follow/store/entry/store"
import { useFeedById } from "@follow/store/feed/hooks"
import { usePrefetchEntryTranslation } from "@follow/store/translation/hooks"
Expand All @@ -12,6 +12,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"
import { useColor } from "react-native-uikit-colors"

import { useActionLanguage, useGeneralSettingKey } from "@/src/atoms/settings/general"
import { useUISettingKey } from "@/src/atoms/settings/ui"
import { BottomTabBarHeightContext } from "@/src/components/layouts/tabbar/contexts/BottomTabBarHeightContext"
import { SafeNavigationScrollView } from "@/src/components/layouts/views/SafeNavigationScrollView"
import { EntryContentWebView } from "@/src/components/native/webview/EntryContentWebView"
Expand Down Expand Up @@ -181,6 +182,9 @@ const EntryInfo = ({ entryId }: { entryId: string }) => {
const feed = useFeedById(entry?.feedId)
const secondaryLabelColor = useColor("secondaryLabel")

const readCount = useEntryReadHistory(entryId)?.entryReadHistories?.readCount
const hideRecentReader = useUISettingKey("hideRecentReader")

if (!entry) return null

const { publishedAt } = entry
Expand All @@ -202,6 +206,11 @@ const EntryInfo = ({ entryId }: { entryId: string }) => {
className="text-secondary-label text-sm leading-tight"
/>
</View>
{!hideRecentReader && (
<View className="flex flex-row items-center gap-1">
<Text className="text-secondary-label text-sm leading-tight">{readCount}</Text>
</View>
)}
</View>
)
}
Expand Down
4 changes: 2 additions & 2 deletions locales/settings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
"appearance.guess_code_language.label": "Guess Code Language",
"appearance.hide_extra_badge.description": "Hide the Special Badge of the Feed in the Sidebar, e.g. Boost, Claimed",
"appearance.hide_extra_badge.label": "Hide Special Badge",
"appearance.hide_recent_reader.description": "Hide the Recent Reader in the Entry Header.",
"appearance.hide_recent_reader.label": "Hide Recent Reader",
"appearance.hide_recent_reader.description": "Hide the Recent Reader and View Count in the Entry.",
"appearance.hide_recent_reader.label": "Hide Recent Readers & View Count",
"appearance.interface_window.title": "Interface & Window",
"appearance.misc": "Misc",
"appearance.modal_overlay.description": "Show Modal Overlay",
Expand Down
4 changes: 2 additions & 2 deletions locales/settings/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
"appearance.guess_code_language.label": "代码语言检测",
"appearance.hide_extra_badge.description": "将侧边栏中订阅源的特殊徽章隐藏,例如:已助力,已认证",
"appearance.hide_extra_badge.label": "隐藏徽章",
"appearance.hide_recent_reader.description": "隐藏条目标题显示的最近阅读者",
"appearance.hide_recent_reader.label": "隐藏最近阅读者",
"appearance.hide_recent_reader.description": "隐藏条目标题显示的最近阅读者与阅读数",
"appearance.hide_recent_reader.label": "隐藏最近阅读者与阅读数",
"appearance.interface_window.title": "界面与窗口",
"appearance.misc": "杂项",
"appearance.modal_overlay.description": "显示遮罩以获得更好的使用体验,推荐开启。",
Expand Down
6 changes: 4 additions & 2 deletions plugins/eslint/eslint-check-i18n-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @type {import("eslint").ESLint.Plugin} */
import fs from "node:fs"

import path from "pathe"
import path, { normalize, sep } from "pathe"

import { cleanJsonText } from "../utils.js"

Expand Down Expand Up @@ -84,7 +84,8 @@ export default {

if (!filename.endsWith(".json")) return

const parts = filename.split(path.sep)
const parts = normalize(filename).split(sep)
// @ts-ignore
const lang = parts.at(-1).split(".")[0]
const namespace = parts.at(-2)

Expand All @@ -95,6 +96,7 @@ export default {

try {
currentJson = JSON.parse(sourceCode.text)
// @ts-ignore
const englishFilePath = path.join(path.dirname(filename), "../", namespace, "en.json")
englishJson = JSON.parse(fs.readFileSync(englishFilePath, "utf8"))
} catch (error) {
Expand Down
Loading