feat: sync settings after onboarding completion in guide modal

This commit is contained in:
songkeys
2025-10-09 22:36:36 +08:00
parent 7a9c95db4a
commit 7d5b0428d2
@@ -4,6 +4,7 @@ import { useEffect } from "react"
import { AIChatRoot } from "~/modules/ai-chat/components/layouts/AIChatRoot"
import { settingSyncQueue } from "../settings/helper/sync-queue"
import { AIChatPane } from "./ai-chat-pane"
import { DiscoverImportStep } from "./discover-import-step"
import { FeedsSelectionList } from "./feeds-selection-list"
@@ -20,6 +21,22 @@ export function GuideModalContent({ onClose }: { onClose: () => void }) {
})
}, [step])
useEffect(() => {
if (step !== "finish") {
return
}
const syncSettings = async () => {
try {
await settingSyncQueue.replaceRemote("general")
} catch (error) {
console.error("Failed to sync settings after onboarding", error)
}
}
syncSettings()
}, [step])
useEffect(() => {
if (step === "finish") {
onClose()