Compare commits
2 commits
948625b777
...
83d406a6aa
| Author | SHA1 | Date | |
|---|---|---|---|
| 83d406a6aa | |||
| c603e81b2a |
8 changed files with 55 additions and 14 deletions
|
|
@ -14,8 +14,8 @@ android {
|
|||
applicationId = "no.naiv.tilfluktsrom"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 16
|
||||
versionName = "1.10.1"
|
||||
versionCode = 17
|
||||
versionName = "1.10.2"
|
||||
|
||||
// Deep link domain — single source of truth for manifest + Kotlin code
|
||||
val deepLinkDomain = "tilfluktsrom.naiv.no"
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class ShelterRepository(private val context: Context) {
|
|||
.readTimeout(60, TimeUnit.SECONDS)
|
||||
.addInterceptor(Interceptor { chain ->
|
||||
chain.proceed(chain.request().newBuilder()
|
||||
.header("User-Agent", "Tilfluktsrom/1.10.1")
|
||||
.header("User-Agent", "Tilfluktsrom/1.10.2")
|
||||
.build())
|
||||
})
|
||||
.build()
|
||||
|
|
|
|||
2
fastlane/metadata/android/en-US/changelogs/17.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/17.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
- PWA-only release: share button is now visually consistent with the other status-bar icons, and updates apply automatically the next time you bring the app to the foreground (no manual reload needed)
|
||||
- No Android changes
|
||||
2
fastlane/metadata/android/nb-NO/changelogs/17.txt
Normal file
2
fastlane/metadata/android/nb-NO/changelogs/17.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
- PWA-utgivelse: del-knappen er visuelt konsistent med de andre ikonene i statuslinjen, og oppdateringer trer i kraft automatisk neste gang du henter appen i forgrunnen (ingen manuell omlasting)
|
||||
- Ingen Android-endringer
|
||||
2
fastlane/metadata/android/nn-NO/changelogs/17.txt
Normal file
2
fastlane/metadata/android/nn-NO/changelogs/17.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
- PWA-utgjeving: del-knappen er visuelt jamn med dei andre ikona i statuslinja, og oppdateringar tek effekt automatisk neste gong du hentar appen i framgrunnen (inga manuell omlasting)
|
||||
- Ingen Android-endringar
|
||||
|
|
@ -25,7 +25,11 @@
|
|||
<header id="status-bar" role="banner">
|
||||
<span id="status-text" aria-live="polite"></span>
|
||||
<button id="about-btn" aria-label="About">ℹ</button>
|
||||
<button id="share-btn" aria-label="Share shelter">↪</button>
|
||||
<button id="share-btn" aria-label="Share shelter">
|
||||
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true" focusable="false">
|
||||
<path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="refresh-btn" aria-label="Refresh data">↻</button>
|
||||
</header>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,44 @@ import './styles/main.css';
|
|||
import 'leaflet/dist/leaflet.css';
|
||||
import { initLocale } from './i18n/i18n';
|
||||
import { init } from './app';
|
||||
import { setStatus } from './ui/status-bar';
|
||||
import { t } from './i18n/i18n';
|
||||
import { maybeShow as maybeShowIosInstallHint } from './ui/install-hint';
|
||||
|
||||
console.info(`[tilfluktsrom] build ${__BUILD_REVISION__}`);
|
||||
|
||||
// Make `registerType: 'autoUpdate'` actually auto-update the running tab.
|
||||
// vite-plugin-pwa's autoUpdate strategy makes the new service worker
|
||||
// skipWaiting + clientsClaim, but the JS already loaded in the open tab is
|
||||
// the *old* build until something triggers a navigation. Without this
|
||||
// listener, a deploy is invisible until the user manually refreshes.
|
||||
//
|
||||
// We *defer* the reload until the user next backgrounds the app
|
||||
// (visibilityState === 'hidden') instead of reloading immediately. This is
|
||||
// an emergency app: a mid-task reload would lose the selected shelter,
|
||||
// compass mode, and any in-flight UI state right when the user can least
|
||||
// afford to be surprised. Deferring keeps the "auto" promise (they're on
|
||||
// the new version next time they look at the screen) without interrupting
|
||||
// active use.
|
||||
//
|
||||
// The `wasAlreadyControlled` guard avoids reloading on the very first SW
|
||||
// install (when there was no previous controller — that's a fresh visit,
|
||||
// not an update).
|
||||
if ('serviceWorker' in navigator) {
|
||||
const wasAlreadyControlled = !!navigator.serviceWorker.controller;
|
||||
let pendingReload = false;
|
||||
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
if (!wasAlreadyControlled) return;
|
||||
pendingReload = true;
|
||||
});
|
||||
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
if (pendingReload && document.visibilityState === 'hidden') {
|
||||
pendingReload = false;
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
initLocale();
|
||||
|
||||
|
|
@ -25,14 +57,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
await navigator.storage.persist();
|
||||
}
|
||||
|
||||
// Listen for service worker updates — flash a status message when a new
|
||||
// version activates so the user knows they have fresh code/data.
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
setStatus(t('update_success'));
|
||||
});
|
||||
}
|
||||
|
||||
await init();
|
||||
|
||||
// Shown only on first iOS Safari visit, once per device. Placed after init()
|
||||
|
|
|
|||
|
|
@ -86,6 +86,13 @@ html, body {
|
|||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
#share-btn svg {
|
||||
display: block;
|
||||
/* `↻` and `ℹ` glyphs sit on a baseline; an SVG inside an inline-flex
|
||||
container can otherwise pick up extra descender space and look
|
||||
misaligned next to them. `display:block` removes that. */
|
||||
}
|
||||
|
||||
/* --- Main content area (map or compass) --- */
|
||||
#main-content {
|
||||
flex: 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue