fixed startup ondomready call to use wails bindings and call when complete

This commit is contained in:
2026-02-25 19:10:37 -05:00
parent cf144bf0dd
commit 012131283c
2 changed files with 17 additions and 17 deletions
+13
View File
@@ -19,6 +19,8 @@ import '@awesome.me/webawesome/dist/components/icon/icon.js';
import { setBasePath } from '@awesome.me/webawesome/dist/webawesome.js';
import { queueStore } from '@store/queue-store';
import { searchStore } from '@store/search-store';
import * as Player from '@go/player/Player';
import * as Queue from '@go/queue/Queue';
// Importing the theme store triggers initialization: it fetches the saved
// theme from the backend and applies CSS custom properties to :root.
import '@store/theme-store';
@@ -164,3 +166,14 @@ document.addEventListener('keydown', (e: KeyboardEvent) => {
}
}
});
// ---------------------------------------------------------------
// Request current state from the backend
// ---------------------------------------------------------------
// All stores have registered their EventsOn listeners by now
// (module-level singletons are instantiated during import
// evaluation), so the state-push events emitted by these
// binding calls will be received deterministically — no sleep
// or timing assumptions needed.
void Player.EmitCurrentState();
void Queue.EmitCurrentState();