Skip to content

Commit 7d5b042

Browse files
committed
feat: sync settings after onboarding completion in guide modal
1 parent 7a9c95d commit 7d5b042

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

apps/desktop/layer/renderer/src/modules/new-user-guide/guide-modal-content.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useEffect } from "react"
44

55
import { AIChatRoot } from "~/modules/ai-chat/components/layouts/AIChatRoot"
66

7+
import { settingSyncQueue } from "../settings/helper/sync-queue"
78
import { AIChatPane } from "./ai-chat-pane"
89
import { DiscoverImportStep } from "./discover-import-step"
910
import { FeedsSelectionList } from "./feeds-selection-list"
@@ -20,6 +21,22 @@ export function GuideModalContent({ onClose }: { onClose: () => void }) {
2021
})
2122
}, [step])
2223

24+
useEffect(() => {
25+
if (step !== "finish") {
26+
return
27+
}
28+
29+
const syncSettings = async () => {
30+
try {
31+
await settingSyncQueue.replaceRemote("general")
32+
} catch (error) {
33+
console.error("Failed to sync settings after onboarding", error)
34+
}
35+
}
36+
37+
syncSettings()
38+
}, [step])
39+
2340
useEffect(() => {
2441
if (step === "finish") {
2542
onClose()

0 commit comments

Comments
 (0)