fix: limit mobile handoff delay to Nextcloud
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 13s

This commit is contained in:
Kroonk
2026-05-21 23:20:11 +02:00
parent d40329ae7c
commit 4c7ef500a1
3 changed files with 5 additions and 25 deletions

24
app.js
View File

@@ -96,25 +96,17 @@ function getMobileLaunch(service) {
fallbackUrl fallbackUrl
}; };
} }
if (!service.mobileUrl) return null; return null;
return {
url: service.mobileUrl,
fallbackUrl: service.url
};
} }
function openMobileLaunch(url, fallbackUrl) { function openMobileLaunch(url, fallbackUrl) {
let didLeavePage = false; let didLeavePage = false;
let fallbackTimer = null; let fallbackTimer = null;
let cleanupTimer = null;
let launcherFrame = null;
const cleanup = () => { const cleanup = () => {
window.removeEventListener('pagehide', markPageLeft); window.removeEventListener('pagehide', markPageLeft);
document.removeEventListener('visibilitychange', handleVisibilityChange); document.removeEventListener('visibilitychange', handleVisibilityChange);
if (fallbackTimer) window.clearTimeout(fallbackTimer); if (fallbackTimer) window.clearTimeout(fallbackTimer);
if (cleanupTimer) window.clearTimeout(cleanupTimer);
if (launcherFrame) launcherFrame.remove();
}; };
const markPageLeft = () => { const markPageLeft = () => {
@@ -143,19 +135,7 @@ function openMobileLaunch(url, fallbackUrl) {
return; return;
} }
launcherFrame = document.createElement('iframe'); window.location.href = url;
launcherFrame.hidden = true;
launcherFrame.style.display = 'none';
launcherFrame.setAttribute('aria-hidden', 'true');
document.body.appendChild(launcherFrame);
launcherFrame.src = url;
cleanupTimer = window.setTimeout(() => {
if (launcherFrame && launcherFrame.parentNode) {
launcherFrame.remove();
launcherFrame = null;
}
}, 2600);
} }
function createServiceCard(service) { function createServiceCard(service) {

View File

@@ -128,6 +128,6 @@
</div> </div>
<script src="/auth.js?v=1" defer></script> <script src="/auth.js?v=1" defer></script>
<script src="/app.js?v=32" defer></script> <script src="/app.js?v=33" defer></script>
</body> </body>
</html> </html>

4
sw.js
View File

@@ -1,4 +1,4 @@
const CACHE_NAME = 'mischlabs-pwa-v15'; const CACHE_NAME = 'mischlabs-pwa-v16';
const APP_SHELL = [ const APP_SHELL = [
'/', '/',
'/index.html', '/index.html',
@@ -6,7 +6,7 @@ const APP_SHELL = [
'/offline.html', '/offline.html',
'/style.css?v=28', '/style.css?v=28',
'/auth.js?v=1', '/auth.js?v=1',
'/app.js?v=32', '/app.js?v=33',
'/favorites.js?v=1', '/favorites.js?v=1',
'/services.json?v=1', '/services.json?v=1',
'/manifest.webmanifest?v=4', '/manifest.webmanifest?v=4',