Skip to content

ROM directories reset on app restart — saveConfig/loadConfig never called #6

@vfmatzkin

Description

@vfmatzkin

Problem

ROM directories configured in the console settings screen are lost when the app is closed and reopened. The user has to manually re-pick every ROM folder each launch.

Root Cause

main.js exposes loadConfig and saveConfig IPC handlers that read/write console-mini.json in app.getPath("userData"). However, the React frontend never calls these handlers.

In the frontend bundle (dist/assets/index-*.js):

  • saveConfig and loadConfig exist only as empty stubs in the bridge mock (saveConfig:async()=>{}, loadConfig:async()=>({}))
  • setRomDir updates the Zustand in-memory store but there is no corresponding bridge.saveConfig() call
  • On mount, there is no bridge.loadConfig() to restore previously saved directories

Expected Behavior

  1. When a user picks a ROM directory for a console, saveConfig should be called to persist it
  2. On app launch, loadConfig should be called and directories restored

Suggested Fix

In the component that calls setRomDir(e, g), add a bridge.saveConfig({ romDirs }) after the state update. On app mount or when the console view loads, call bridge.loadConfig() and hydrate the Zustand store.

Version

0.1.2 (arm64) — console-mini.json is written on disk by main but is never referenced by the frontend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions