Skip to content

Bug: Settings not persisting across sessions — root cause identified + workaround #25

@NodiLevator

Description

@NodiLevator

Bug description

Settings across all tabs (General, ASR, TTS, Agent, and possibly others) reset to
defaults every time the app is restarted. For example, toggling "Show Subtitle" off
will appear to work, but on next launch it's back on.

This likely affects both the web and Electron versions since they share the same
frontend codebase.

Steps to reproduce

  1. Launch the app (web or Electron)
  2. Change any setting (e.g. toggle Show Subtitle off)
  3. Close and relaunch the app
  4. Setting has reset to default

Root cause

Found in index-CW5qlpM1.js inside the useGeneralSettings hook. A useEffect
syncs a local React state object (settings2) back to the individual state setters
on every render:

reactExports.useEffect(() => {
  setShowSubtitle(settings2.showSubtitle); // <-- culprit
  ...
});

settings2 is initialized with plain useState(initialSettings) — never persisted.
So on every render cycle it overwrites whatever useLocalStorage had correctly saved,
resetting everything back to hardcoded defaults.

Workaround (Electron users only)

Extract app.asar, then in out/renderer/assets/index-CW5qlpM1.js find and replace:

setShowSubtitle(settings2.showSubtitle);

with:

// setShowSubtitle(settings2.showSubtitle);

Using PowerShell:

$path = "C:\Users\<yourname>\asar-extract\out\renderer\assets\index-CW5qlpM1.js"
$content = Get-Content $path -Raw
$content = $content.Replace(
    "setShowSubtitle(settings2.showSubtitle);",
    "// setShowSubtitle(settings2.showSubtitle);"
)
Set-Content $path $content -NoNewline

Then repack the asar:

cmd /c npx asar pack "C:\Users\<yourname>\asar-extract" "C:\Users\<yourname>\AppData\Local\Programs\open-llm-vtuber\resources\app.asar"

Web users will need to wait for an official fix.

Notes

  • Some settings (e.g. Live2D scroll to resize) are still not persisting — likely
    managed by a separate hook with the same pattern, not investigated yet.
  • A more thorough fix would move settings2 itself to useLocalStorage, or remove
    the useEffect sync entirely and let each setting manage its own persistence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions