feat: sync settings after onboarding completion in guide modal
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user