Spaces:
Running
Running
fix: show welcome overlay immediately on DOM load, before any async operations
Browse files- Move overlay.show() to DOMContentLoaded event, before initialize()
- Remove overlay call from async initialize() function
- Ensures overlay appears immediately when page loads
- Prevents any loading messages from appearing before welcome
- src/app.js +4 -3
src/app.js
CHANGED
@@ -29,9 +29,6 @@ class App {
|
|
29 |
|
30 |
async initialize() {
|
31 |
try {
|
32 |
-
// Show welcome overlay immediately before loading
|
33 |
-
this.welcomeOverlay.show();
|
34 |
-
|
35 |
this.showLoading(true);
|
36 |
await this.game.initialize();
|
37 |
await this.startNewGame();
|
@@ -314,6 +311,10 @@ class App {
|
|
314 |
// Initialize the app when DOM is loaded
|
315 |
document.addEventListener('DOMContentLoaded', () => {
|
316 |
const app = new App();
|
|
|
|
|
|
|
|
|
317 |
app.initialize();
|
318 |
|
319 |
// Expose API key setter for browser console
|
|
|
29 |
|
30 |
async initialize() {
|
31 |
try {
|
|
|
|
|
|
|
32 |
this.showLoading(true);
|
33 |
await this.game.initialize();
|
34 |
await this.startNewGame();
|
|
|
311 |
// Initialize the app when DOM is loaded
|
312 |
document.addEventListener('DOMContentLoaded', () => {
|
313 |
const app = new App();
|
314 |
+
|
315 |
+
// Show welcome overlay immediately before any loading
|
316 |
+
app.welcomeOverlay.show();
|
317 |
+
|
318 |
app.initialize();
|
319 |
|
320 |
// Expose API key setter for browser console
|