missions: no-store fetch + visible updated-at timestamp on refresh
- api client: cache: no-store so manual Refresh guarantees a fresh server response (was potentially hitting stale HTTP cache). - MissionCanvas: renders "updated HH:MM:SS" next to the refresh button; the timestamp bumps on every successful load so the click is visibly acknowledged even when nothing else on the page changed.
This commit is contained in:
@@ -118,6 +118,7 @@ export function MissionCanvas({
|
||||
const [editOpen, setEditOpen] = useState(false);
|
||||
const [deleteBusy, setDeleteBusy] = useState(false);
|
||||
const [runs, setRuns] = useState<MissionRunSummary[]>([]);
|
||||
const [lastLoadedAt, setLastLoadedAt] = useState<Date | null>(null);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
if (!selectedId) {
|
||||
@@ -133,6 +134,7 @@ export function MissionCanvas({
|
||||
]);
|
||||
setMission(m);
|
||||
setRuns(r.runs);
|
||||
setLastLoadedAt(new Date());
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : "load failed");
|
||||
} finally {
|
||||
@@ -424,6 +426,18 @@ export function MissionCanvas({
|
||||
{refining ? "Refining…" : "Refine"}
|
||||
</button>
|
||||
)}
|
||||
{lastLoadedAt && (
|
||||
<span
|
||||
style={{
|
||||
fontSize: 10,
|
||||
color: "#6a6a72",
|
||||
fontFamily: mono,
|
||||
}}
|
||||
title={lastLoadedAt.toISOString()}
|
||||
>
|
||||
updated {lastLoadedAt.toLocaleTimeString()}
|
||||
</span>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
onClick={load}
|
||||
|
||||
Reference in New Issue
Block a user