refactor: Enhance onboarding wizard completion logic

- Updated the skipWizard and finishWizard functions to save onboarding completion status to disk using the electronAPI, ensuring both local state and persistent storage are updated.
- Improved comments for clarity on the new behavior of saving settings.
This commit is contained in:
AndyMik90
2025-12-15 19:31:12 +01:00
parent a5a1eb1431
commit 7c01638a81
@@ -82,15 +82,17 @@ export function OnboardingWizard({
}, [currentStepIndex]);
const skipWizard = useCallback(async () => {
// Mark onboarding as completed and close
await updateSettings({ onboardingCompleted: true });
// Mark onboarding as completed and close - save to disk AND update local state
await window.electronAPI.saveSettings({ onboardingCompleted: true });
updateSettings({ onboardingCompleted: true });
onOpenChange(false);
resetWizard();
}, [updateSettings, onOpenChange]);
const finishWizard = useCallback(async () => {
// Mark onboarding as completed
await updateSettings({ onboardingCompleted: true });
// Mark onboarding as completed - save to disk AND update local state
await window.electronAPI.saveSettings({ onboardingCompleted: true });
updateSettings({ onboardingCompleted: true });
onOpenChange(false);
resetWizard();
}, [updateSettings, onOpenChange]);