merge app-update into info section, add CalVer app version

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 22:52:09 +01:00
parent 22bf485b76
commit bbbe570e11
2 changed files with 19 additions and 26 deletions

View File

@@ -7,7 +7,7 @@ import { useFollows } from "@/shared/hooks/use-follows"
import { usePush } from "@/shared/hooks/use-push"
import { usePwaUpdate } from "@/shared/hooks/use-pwa-update"
import { fetchTopics } from "@/shared/lib/aw-api"
import { BACKEND_URL, VAPID_PUBLIC_KEY } from "@/shared/lib/constants"
import { APP_VERSION, BACKEND_URL, VAPID_PUBLIC_KEY } from "@/shared/lib/constants"
import { useCallback, useEffect, useState } from "react"
import { type GeoResult, clearGeoCache, detectFromCoords, loadCachedResult } from "../../location/lib/geo"
import { NotificationGuide } from "./notification-guide"
@@ -171,35 +171,26 @@ export function SettingsPage() {
</Card>
</section>
{/* --- App Update --- */}
<section>
<h2 className="text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-2">App-Update</h2>
<Card className="py-0 gap-0">
<CardContent className="p-0">
{needRefresh ? (
<div className="flex items-center justify-between px-4 py-3">
<span className="text-sm">Neue Version verfügbar</span>
<Button size="sm" onClick={applyUpdate}>
Jetzt aktualisieren
</Button>
</div>
) : (
<div className="flex items-center justify-between px-4 py-3">
<span className="text-sm">App ist aktuell</span>
<Button size="sm" variant="outline" onClick={handleCheckUpdate} disabled={checking}>
{checking ? "Prüfe…" : "Prüfen"}
</Button>
</div>
)}
</CardContent>
</Card>
</section>
{/* --- About --- */}
{/* --- Info --- */}
<section>
<h2 className="text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-2">Info</h2>
<Card className="py-0 gap-0">
<CardContent className="p-0 divide-y divide-border">
<div className="flex justify-between px-4 py-3">
<span className="text-sm">Version</span>
<div className="flex items-center gap-2">
<span className="text-sm text-muted-foreground">{APP_VERSION}</span>
{needRefresh ? (
<Button size="sm" onClick={applyUpdate}>
Aktualisieren
</Button>
) : (
<Button size="sm" variant="outline" onClick={handleCheckUpdate} disabled={checking}>
{checking ? "Prüfe…" : "Prüfen"}
</Button>
)}
</div>
</div>
<div className="flex justify-between px-4 py-3">
<span className="text-sm">Datenquelle</span>
<a

View File

@@ -1,3 +1,5 @@
export const APP_VERSION = "2026.03.02.1"
export const AW_API_BASE = "https://www.abgeordnetenwatch.de/api/v2"
export const AW_API_TIMEOUT_MS = 20_000