Merge pull request #4732 from RSSNext/sync/main-to-dev-20251119

Sync main branch to dev branch
This commit is contained in:
DIYgod
2025-11-19 10:07:20 +08:00
committed by GitHub
8 changed files with 58 additions and 21 deletions
@@ -198,10 +198,10 @@ export function MainDestopLayout() {
CustomModalComponent={PlainModal}
overlay
title="Login"
canClose={!IN_ELECTRON}
clickOutsideToDismiss={!IN_ELECTRON}
canClose={true}
clickOutsideToDismiss={true}
>
<LoginModalContent canClose={!IN_ELECTRON} runtime={IN_ELECTRON ? "app" : "browser"} />
<LoginModalContent canClose={true} runtime={IN_ELECTRON ? "app" : "browser"} />
</DeclarativeModal>
</RootPortal>
)}
@@ -10,6 +10,7 @@ import {
} from "@follow/components/ui/form/index.js"
import { Input } from "@follow/components/ui/input/Input.js"
import type { LoginRuntime } from "@follow/shared/auth"
import { IN_ELECTRON } from "@follow/shared/constants"
import { env } from "@follow/shared/env.desktop"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
@@ -28,7 +29,7 @@ import { ReferralForm } from "./ReferralForm"
const formSchema = z.object({
email: z.string().email(),
password: z.string().min(8).max(128).or(z.literal("")),
password: IN_ELECTRON ? z.string().min(8).max(128) : z.string().min(8).max(128).or(z.literal("")),
})
export function LoginWithPassword({
@@ -60,7 +61,7 @@ export function LoginWithPassword({
}
: undefined
if (!values.password || values.password.trim() === "") {
if (!IN_ELECTRON && (!values.password || values.password.trim() === "")) {
const result = await loginHandler("magicLink", runtime, {
email: values.email,
headers,
@@ -132,7 +133,11 @@ export function LoginWithPassword({
render={({ field }) => (
<FormItem className="mt-4">
<FormLabel className="flex items-center justify-between">
<span>{`${t("login.password")} (${t("login.password_optional")})`}</span>
<span>
{IN_ELECTRON
? t("login.password")
: `${t("login.password")} (${t("login.password_optional")})`}
</span>
<a
href={`${env.VITE_WEB_URL}/forget-password`}
target="_blank"
@@ -157,9 +162,9 @@ export function LoginWithPassword({
disabled={!form.formState.isValid}
size="lg"
>
{!form.watch("password") || form.watch("password")?.trim() === ""
? t("login.send_magic_link")
: t("login.continueWith", { provider: t("words.email") })}
{IN_ELECTRON || (form.watch("password") && form.watch("password")?.trim() !== "")
? t("login.continueWith", { provider: t("words.email") })
: t("login.send_magic_link")}
</Button>
</div>
</form>
@@ -184,8 +189,10 @@ export function LoginWithPassword({
const registerFormSchema = z
.object({
email: z.string().email(),
password: z.string().min(8).max(128).or(z.literal("")),
confirmPassword: z.string().or(z.literal("")),
password: IN_ELECTRON
? z.string().min(8).max(128)
: z.string().min(8).max(128).or(z.literal("")),
confirmPassword: IN_ELECTRON ? z.string() : z.string().or(z.literal("")),
})
.refine((data) => data.password === data.confirmPassword, {
message: "Passwords don't match",
@@ -222,7 +229,7 @@ export function RegisterForm({
}
: undefined
if (!values.password || values.password.trim() === "") {
if (!IN_ELECTRON && (!values.password || values.password.trim() === "")) {
const result = await loginHandler("magicLink", runtime, {
email: values.email,
headers,
@@ -276,7 +283,11 @@ export function RegisterForm({
name="password"
render={({ field }) => (
<FormItem>
<FormLabel>{`${t("register.password")} (${t("register.password_optional")})`}</FormLabel>
<FormLabel>
{IN_ELECTRON
? t("register.password")
: `${t("register.password")} (${t("register.password_optional")})`}
</FormLabel>
<FormControl>
<Input type="password" {...field} />
</FormControl>
@@ -290,7 +301,9 @@ export function RegisterForm({
render={({ field }) => (
<FormItem>
<FormLabel>
{`${t("register.confirm_password")} (${t("register.password_optional")})`}
{IN_ELECTRON
? t("register.confirm_password")
: `${t("register.confirm_password")} (${t("register.password_optional")})`}
</FormLabel>
<FormControl>
<Input type="password" {...field} />
@@ -307,9 +320,9 @@ export function RegisterForm({
isLoading={form.formState.isSubmitting}
disabled={!form.formState.isValid}
>
{!form.watch("password") || form.watch("password")?.trim() === ""
? t("register.send_magic_link")
: t("register.submit")}
{IN_ELECTRON || (form.watch("password") && form.watch("password")?.trim() !== "")
? t("register.submit")
: t("register.send_magic_link")}
</Button>
</form>
</Form>
@@ -22,13 +22,13 @@ export const UserProBadge = ({
<div
className={cn(
"flex items-center gap-1",
role === UserRole.Trial || role === UserRole.Free ? "text-text-secondary" : "text-accent",
role === UserRole.Trial || role === UserRole.Free ? "text-text-secondary" : "text-folo",
className,
)}
onClick={onClick}
>
<i className={cn("i-mgc-power block text-folo", iconClassName)} />
{withText && <span className="text-xs text-folo">{UserRoleName[role]}</span>}
<i className={cn("i-mgc-power block", iconClassName)} />
{withText && <span className="text-xs">{UserRoleName[role]}</span>}
</div>
)
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "Folo",
"type": "module",
"version": "1.1.6",
"version": "1.1.7",
"private": true,
"description": "Follow everything in one place",
"author": "Folo Team",
+1
View File
@@ -576,6 +576,7 @@
"plan.features.MAX_AI_REQUESTS_PER_DAY": "AI Chats Per Day",
"plan.features.MAX_AI_REQUESTS_PER_MONTH": "AI Chats Per Month",
"plan.features.MAX_AI_TASKS": "AI Tasks",
"plan.features.MAX_AI_TEXT_TO_SPEECH_PER_DAY": "AI Text-to-Speech Per Day",
"plan.features.MAX_INBOXES": "Inbox",
"plan.features.MAX_LISTS": "List",
"plan.features.MAX_RSSHUB_SUBSCRIPTIONS": "RSSHub Subscriptions",
+1
View File
@@ -571,6 +571,7 @@
"plan.features.MAX_AI_REQUESTS_PER_DAY": "1日あたりのAIリクエスト数",
"plan.features.MAX_AI_REQUESTS_PER_MONTH": "1ヶ月あたりのAIリクエスト数",
"plan.features.MAX_AI_TASKS": "AI タスク",
"plan.features.MAX_AI_TEXT_TO_SPEECH_PER_DAY": "1日あたりのAI音声合成数",
"plan.features.MAX_INBOXES": "受信トレイフィード",
"plan.features.MAX_LISTS": "カスタムリスト",
"plan.features.MAX_RSSHUB_SUBSCRIPTIONS": "RSSHub サブスクリプション",
+1
View File
@@ -570,6 +570,7 @@
"plan.features.MAX_AI_REQUESTS_PER_DAY": "每日 AI 对话次数",
"plan.features.MAX_AI_REQUESTS_PER_MONTH": "每月 AI 对话次数",
"plan.features.MAX_AI_TASKS": "AI 任务",
"plan.features.MAX_AI_TEXT_TO_SPEECH_PER_DAY": "每日 AI 语音合成次数",
"plan.features.MAX_INBOXES": "收件箱订阅源",
"plan.features.MAX_LISTS": "自定义列表",
"plan.features.MAX_RSSHUB_SUBSCRIPTIONS": "RSSHub 订阅",
+21
View File
@@ -562,6 +562,27 @@
"plan.descriptions.free": "非常適合初學者。",
"plan.descriptions.plus": "解鎖 AI 功能和更多訂閱源。",
"plan.descriptions.pro": "完整享受 Folo 的最佳功能。",
"plan.featureValues.AI_MODEL_SELECTION.curated": "精選模型",
"plan.featureValues.AI_MODEL_SELECTION.high_performance": "全部高效能模型",
"plan.featureValues.AI_MODEL_SELECTION.none": "—",
"plan.features.AI_BRING_YOUR_OWN_KEY": "AI 自訂 API 金鑰",
"plan.features.AI_CREDIT": "AI Chat 點數",
"plan.features.AI_MODEL_SELECTION": "AI 模型選擇",
"plan.features.BOOSTS": "訂閱源更新加速",
"plan.features.INTEGRATION_SUPPORTED": "第三方整合",
"plan.features.MAX_ACTIONS": "自動化操作",
"plan.features.MAX_AI_ENTRY_SUMMARY_PER_DAY": "每日 AI 摘要次數",
"plan.features.MAX_AI_ENTRY_TRANSLATION_PER_DAY": "每日 AI 翻譯次數",
"plan.features.MAX_AI_REQUESTS_PER_DAY": "每日 AI 對話次數",
"plan.features.MAX_AI_REQUESTS_PER_MONTH": "每月 AI 對話次數",
"plan.features.MAX_AI_TASKS": "AI 任務",
"plan.features.MAX_AI_TEXT_TO_SPEECH_PER_DAY": "每日 AI 語音合成次數",
"plan.features.MAX_INBOXES": "收件箱訂閱源",
"plan.features.MAX_LISTS": "自訂列表",
"plan.features.MAX_RSSHUB_SUBSCRIPTIONS": "RSSHub 訂閱",
"plan.features.MAX_SUBSCRIPTIONS": "訂閱源數量",
"plan.features.PRIORITY_SUPPORT": "優先支援",
"plan.features.PRIVATE_SUBSCRIPTION": "私有訂閱",
"privacy.privacy": "隱私政策",
"privacy.terms": "服務條款",
"profile.avatar.cropInstructions": "拖曳裁切區域以調整你的頭像",