@hkdigital/lib-core 0.5.14 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -302,10 +302,39 @@
|
|
|
302
302
|
};
|
|
303
303
|
portraitMediaQuery.addEventListener('change', handleOrientationChange);
|
|
304
304
|
|
|
305
|
+
// App visibility detection for iOS debugging
|
|
306
|
+
const handleVisibilityChange = () => {
|
|
307
|
+
if (document.visibilityState === 'visible') {
|
|
308
|
+
// console.log('App became visible:', {
|
|
309
|
+
// 'window.innerWidth': window.innerWidth,
|
|
310
|
+
// 'window.innerHeight': window.innerHeight,
|
|
311
|
+
// 'screen.width': screen.width,
|
|
312
|
+
// 'screen.height': screen.height,
|
|
313
|
+
// 'screen.orientation.angle': screen.orientation.angle,
|
|
314
|
+
// 'screen.orientation.type': screen.orientation.type,
|
|
315
|
+
// 'matchMedia portrait':
|
|
316
|
+
// window.matchMedia('(orientation: portrait)').matches,
|
|
317
|
+
// 'isLandscape': isLandscape,
|
|
318
|
+
// 'gameWidth': gameWidth,
|
|
319
|
+
// 'gameHeight': gameHeight,
|
|
320
|
+
// 'iosWindowWidth': iosWindowWidth,
|
|
321
|
+
// 'iosWindowHeight': iosWindowHeight
|
|
322
|
+
// });
|
|
323
|
+
|
|
324
|
+
// Force iOS dimension update when app becomes visible
|
|
325
|
+
if (isPwa && isAppleMobile) {
|
|
326
|
+
updateIosWidthHeight();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
332
|
+
|
|
305
333
|
show = true;
|
|
306
334
|
|
|
307
335
|
return () => {
|
|
308
336
|
portraitMediaQuery.removeEventListener('change', handleOrientationChange);
|
|
337
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
309
338
|
};
|
|
310
339
|
});
|
|
311
340
|
|