Use default Wails asset handler + GetStoredConfig binding
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

- Remove custom asset handler — it broke Wails IPC routing
- Use application.AssetFileServerFS(distFS) so Wails serves its own runtime
- Add GetStoredConfig binding: SPA calls it on startup to retrieve keychain config
- main.ts: loadDesktopConfig() fetches stored creds before mounting
- Remove runtime.js embed (Wails serves it internally)
This commit is contained in:
2026-07-13 23:45:54 +02:00
parent 0271727709
commit ff6608f9ea
3 changed files with 41 additions and 65 deletions

View File

@@ -1,11 +1,29 @@
import { mount } from 'svelte'
import App from './App.svelte'
import './app.css'
import { initConfig } from '$lib/config'
import { initConfig, setConfig } from '$lib/config'
initConfig()
async function loadDesktopConfig() {
const wails = (window as any).wails
if (!wails?.Call?.ByName) return
requestAnimationFrame(() => import('./lib/renderers'))
try {
const cfg = await wails.Call.ByName('GetStoredConfig')
if (cfg?.apiUrl && cfg?.token) {
setConfig({ apiUrl: cfg.apiUrl, token: cfg.token, isDesktop: true })
}
} catch {
// no stored config — Config page will handle it
}
}
const app = mount(App, { target: document.getElementById('app')! })
export default app
async function start() {
initConfig()
await loadDesktopConfig()
requestAnimationFrame(() => import('./lib/renderers'))
mount(App, { target: document.getElementById('app')! })
}
start()