Skip to content

Commit f4c3eb6

Browse files
committed
quick emergency bug fix
1 parent 7481a64 commit f4c3eb6

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

src/lib/components/CardGrid.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
return bClicks - aClicks;
8282
});
8383
}
84+
console.log(
85+
`Sorted games by ${sortType}:`,
86+
sorted.length
87+
)
8488
return sorted;
8589
}
8690

src/lib/state.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ export const State = createState({
7070
});
7171

7272

73+
export let toolingInitialized = false;
74+
7375
export async function initializeTooling() {
76+
if (toolingInitialized) return;
7477
const server = await findServer();
7578
if (!server) {
7679
console.error("No available servers found.");
@@ -94,6 +97,7 @@ export async function initializeTooling() {
9497
SessionState.awsReady = true;
9598
SessionState.dynamoDBClient = dynamoDBClient;
9699
SessionState.s3Client = s3Client;
100+
toolingInitialized = true;
97101
}
98102
export function waitForTooling(): Promise<void> {
99103
return new Promise((resolve) => {

src/routes/+layout.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script lang="ts">
2+
let { children } = $props();
3+
</script>
4+
5+
6+
7+
{@render children()}

src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
await initializeTooling();
2121
isAHost = State.isAHost();
2222
23-
await loadGames();
23+
games = await loadGames();
2424
devMode = SessionState.devMode;
2525
adblockEnabled = SessionState.adBlockEnabled;
2626
adsEnabled = SessionState.adsEnabled;

static/sw.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ self.addEventListener('install', event => {
107107
// Load servers list
108108
updateAllowedDomains()
109109
]).then(() => {
110-
console.log('Service worker installation completed');
111110
return self.skipWaiting();
112111
}).catch(error => {
113112
console.error('Service worker installation failed:', error);
@@ -225,7 +224,6 @@ async function networkFirstStrategy(request) {
225224
throw new Error('Invalid network response');
226225

227226
} catch (error) {
228-
console.log('Network failed, trying cache for:', request.url, error.message);
229227

230228
// Fall back to cache
231229
const cachedResponse = await cache.match(request);
@@ -262,7 +260,6 @@ async function cacheFirstStrategy(request) {
262260

263261
// Fetch from network
264262
try {
265-
console.log('Fetching and caching game asset:', request.url);
266263

267264
const url = new URL(request.url);
268265
const fetchOptions = {};
@@ -306,9 +303,6 @@ self.addEventListener('fetch', async event => {
306303

307304
const request = event.request;
308305
const isCacheable = await isCacheableRequest(request);
309-
if (isCacheable) {
310-
console.log('[Cacheable] ', request.url);
311-
}
312306
if (!isCacheable) {
313307
return;
314308
}

0 commit comments

Comments
 (0)