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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user