Skip to content

[pull] main from electh:main #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Read in other languages: [Deutsch](docs/README.de-DE.md), [Español](docs/README

ReactFlux is a third-party web frontend for [Miniflux](https://github.com/miniflux/v2), aimed at providing a more user-friendly reading experience.

Supported Miniflux versions: 2.1.4 and higher.

Key features include:

- Modern interface design
Expand Down
2 changes: 2 additions & 0 deletions docs/README.de-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ In anderen Sprachen lesen: [English](../README.md), [Español](README.es-ES.md),

ReactFlux ist ein Drittanbieter-Web-Frontend für [Miniflux](https://github.com/miniflux/v2), das ein benutzerfreundlicheres Leseerlebnis bieten soll.

Unterstützte Miniflux-Versionen: 2.1.4 und höher.

Die wichtigsten Merkmale sind:

- Modernes Oberflächendesign
Expand Down
2 changes: 2 additions & 0 deletions docs/README.es-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Lea este texto en otros idiomas: [Deutsch](README.de-DE.md), [English](../README

ReactFlux es una interfaz web de terceros para [Miniflux](https://github.com/miniflux/v2), cuyo objetivo es proporcionar una experiencia de lectura más fácil de usar.

Versiones de Miniflux compatibles: 2.1.4 y superiores.

Las funcionalidades clave incluyen:

- Diseño de interfaz moderna
Expand Down
2 changes: 2 additions & 0 deletions docs/README.fr-FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Lire dans d'autres langues : [Deutsch](README.de-DE.md), [English](../README.md)

ReactFlux est une interface web tierce pour [Miniflux](https://github.com/miniflux/v2), visant à offrir une expérience de lecture plus conviviale.

Versions Miniflux prises en charge : 2.1.4 et supérieures.

Les fonctionnalités principales incluent :

- Design d'interface moderne
Expand Down
2 changes: 2 additions & 0 deletions docs/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

ReactFlux 是 [Miniflux](https://github.com/miniflux/v2) 的第三方 Web 前端,旨在提供更加友好的阅读体验。

支持的 Miniflux 版本:2.1.4 及更高版本。

主要特性包括:

- 现代化的界面设计
Expand Down
15 changes: 14 additions & 1 deletion src/apis/categories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import apiClient from "./ofetch"

import { dataState } from "@/store/dataState"
import compareVersions from "@/utils/version"

export const getCategories = async () => apiClient.get("/v1/categories")

export const addCategory = async (title) => apiClient.post("/v1/categories", { title })
Expand All @@ -8,7 +11,17 @@ export const deleteCategory = async (id) =>
apiClient.raw(`/v1/categories/${id}`, { method: "DELETE" })

export const updateCategory = async (id, newTitle, hidden = false) => {
const params = { title: newTitle, hide_globally: hidden ? "on" : undefined }
const { version } = dataState.get()

let hide_globally

if (compareVersions(version, "2.2.8") >= 0) {
hide_globally = hidden
} else {
hide_globally = hidden ? "on" : undefined
}

const params = { title: newTitle, hide_globally }
return apiClient.put(`/v1/categories/${id}`, params)
}

Expand Down
7 changes: 5 additions & 2 deletions src/apis/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ export const updateEntriesStatus = async (entryIds, newStatus) =>
export const toggleEntryStarred = async (entryId) =>
apiClient.put(`/v1/entries/${entryId}/bookmark`)

export const getOriginalContent = async (entryId) =>
apiClient.get(`/v1/entries/${entryId}/fetch-content`)
export const getOriginalContent = async (entryId) => {
const { updateContentOnFetch } = getSettings("updateContentOnFetch")
const queryParams = updateContentOnFetch ? "?update_content=true" : ""
return apiClient.get(`/v1/entries/${entryId}/fetch-content${queryParams}`)
}

export const saveToThirdPartyServices = async (entryId) =>
apiClient.raw(`/v1/entries/${entryId}/save`, { method: "POST" })
Expand Down
20 changes: 20 additions & 0 deletions src/components/Settings/General.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import SettingItem from "./SettingItem"

import { polyglotState } from "@/hooks/useLanguage"
import useScreenWidth from "@/hooks/useScreenWidth"
import { dataState } from "@/store/dataState"
import { settingsState, updateSettings } from "@/store/settingsState"
import compareVersions from "@/utils/version"

const languageOptions = [
{ label: "Deutsch", value: "de-DE" },
Expand All @@ -16,6 +18,7 @@ const languageOptions = [
]

const General = () => {
const { version } = useStore(dataState)
const {
enableSwipeGesture,
homePage,
Expand All @@ -26,6 +29,7 @@ const General = () => {
pageSize,
removeDuplicates,
swipeSensitivity,
updateContentOnFetch,
} = useStore(settingsState)
const { polyglot } = useStore(polyglotState)
const { isBelowMedium } = useScreenWidth()
Expand Down Expand Up @@ -190,6 +194,22 @@ const General = () => {
/>
</SettingItem>

{compareVersions(version, "2.2.8") >= 0 && (
<>
<Divider />

<SettingItem
description={polyglot.t("settings.update_content_on_fetch_description")}
title={polyglot.t("settings.update_content_on_fetch_label")}
>
<Switch
checked={updateContentOnFetch}
onChange={(value) => updateSettings({ updateContentOnFetch: value })}
/>
</SettingItem>
</>
)}

{isBelowMedium && (
<>
<Divider />
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useEntryActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ const useEntryActions = () => {
try {
const response = await getOriginalContent(activeContent.id)
Message.success(polyglot.t("actions.fetched_content_success"))
setActiveContent({ ...activeContent, content: response.content })
const newContent = response.content
const newReadingTime = response.reading_time ?? activeContent.reading_time
setActiveContent({ ...activeContent, content: newContent, readingTime: newReadingTime })
} catch (error) {
console.error("Failed to fetch content: ", error)
Message.error(polyglot.t("actions.fetched_content_error"))
Expand Down
6 changes: 4 additions & 2 deletions src/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@
"mark_read_on_view": "Ansehen",
"enable_swipe_gesture_description": "Swipe-Geste nach links und rechts zum Wechseln von Artikeln aktivieren",
"enable_swipe_gesture_label": "Swipe-Geste aktivieren",
"swipe_sensitivity_description": "Swipe-Geste-Empfindlichkeit anpassen",
"swipe_sensitivity_label": "Swipe-Geste-Empfindlichkeit"
"swipe_sensitivity_description": "Empfindlichkeit der Wischgesten anpassen",
"swipe_sensitivity_label": "Wischempfindlichkeit",
"update_content_on_fetch_label": "Abgerufene Inhalte automatisch speichern",
"update_content_on_fetch_description": "Abgerufene Inhalte automatisch aktualisieren und in der Datenbank speichern"
},
"appearance": {
"theme_color_label": "Themenfarbe",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@
"mark_read_on_view": "View",
"enable_swipe_gesture_description": "Enable swipe gesture to switch articles",
"enable_swipe_gesture_label": "Enable swipe gesture",
"swipe_sensitivity_description": "Adjust swipe gesture sensitivity",
"swipe_sensitivity_label": "Swipe sensitivity"
"swipe_sensitivity_description": "Adjust the sensitivity of swipe gestures",
"swipe_sensitivity_label": "Swipe sensitivity",
"update_content_on_fetch_label": "Auto-save fetched content",
"update_content_on_fetch_description": "Automatically update and save fetched content to database"
},
"appearance": {
"theme_color_label": "Theme color",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@
"mark_read_on_view": "Ver",
"enable_swipe_gesture_description": "Habilitar gesto de deslizamiento para cambiar artículos",
"enable_swipe_gesture_label": "Habilitar gesto de deslizamiento",
"swipe_sensitivity_description": "Ajustar la sensibilidad del gesto de deslizamiento",
"swipe_sensitivity_label": "Sensibilidad del deslizamiento"
"swipe_sensitivity_description": "Ajustar la sensibilidad de los gestos de deslizamiento",
"swipe_sensitivity_label": "Sensibilidad de deslizamiento",
"update_content_on_fetch_label": "Guardar automáticamente el contenido obtenido",
"update_content_on_fetch_description": "Actualizar y guardar automáticamente el contenido obtenido en la base de datos"
},
"appearance": {
"theme_color_label": "Color del tema",
Expand Down
6 changes: 4 additions & 2 deletions src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@
"mark_read_on_view": "Voir",
"enable_swipe_gesture_description": "Activer le geste de balayage pour changer d'article",
"enable_swipe_gesture_label": "Activer le geste de balayage",
"swipe_sensitivity_description": "Ajuster la sensibilité du geste de balayage",
"swipe_sensitivity_label": "Sensibilité du balayage"
"swipe_sensitivity_description": "Ajuster la sensibilité des gestes de balayage",
"swipe_sensitivity_label": "Sensibilité du balayage",
"update_content_on_fetch_label": "Enregistrer automatiquement le contenu récupéré",
"update_content_on_fetch_description": "Mettre à jour et enregistrer automatiquement le contenu récupéré dans la base de données"
},
"appearance": {
"theme_color_label": "Couleur du thème",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@
"enable_swipe_gesture_description": "启用左右滑动手势来切换文章",
"enable_swipe_gesture_label": "启用滑动手势",
"swipe_sensitivity_description": "调整滑动手势的灵敏度",
"swipe_sensitivity_label": "滑动灵敏度"
"swipe_sensitivity_label": "滑动灵敏度",
"update_content_on_fetch_label": "获取原文时自动保存",
"update_content_on_fetch_description": "获取原文时自动更新并保存到数据库"
},
"appearance": {
"theme_color_label": "主题颜色",
Expand Down
1 change: 1 addition & 0 deletions src/store/settingsState.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const defaultValue = {
themeColor: "Blue",
themeMode: "system",
titleAlignment: "center",
updateContentOnFetch: false,
}

export const settingsState = persistentAtom("settings", defaultValue, {
Expand Down
Loading