Pass force=true on manual refresh to bypass server cache

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-01 17:50:02 +00:00
parent 87043ba6af
commit 5dd471c92c

View file

@ -36,10 +36,11 @@ export function AdminMonitor({ user }: { user: User }) {
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [deploying, setDeploying] = useState<Set<string>>(new Set()) const [deploying, setDeploying] = useState<Set<string>>(new Set())
async function fetchStatus() { async function fetchStatus(force = false) {
setLoading(true) setLoading(true)
try { try {
const res = await fetch('/deploy/status', { credentials: 'include' }) const url = force ? '/deploy/status?force=true' : '/deploy/status'
const res = await fetch(url, { credentials: 'include' })
if (res.ok) setStatuses(await res.json()) if (res.ok) setStatuses(await res.json())
} finally { } finally {
setLoading(false) setLoading(false)
@ -127,7 +128,7 @@ export function AdminMonitor({ user }: { user: User }) {
<div style={{ flex: 1, overflowY: 'auto', padding: '1.5rem 2rem' }}> <div style={{ flex: 1, overflowY: 'auto', padding: '1.5rem 2rem' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '1rem' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '1rem' }}>
<h2 style={{ fontSize: '1rem', fontWeight: 600 }}>App Updates</h2> <h2 style={{ fontSize: '1rem', fontWeight: 600 }}>App Updates</h2>
<button onClick={fetchStatus} disabled={loading} style={{ <button onClick={() => fetchStatus(true)} disabled={loading} style={{
background: 'var(--surface-2)', border: 'none', borderRadius: '6px', background: 'var(--surface-2)', border: 'none', borderRadius: '6px',
color: 'var(--text-muted)', padding: '0.4rem 1rem', fontSize: '0.8rem', cursor: 'pointer', color: 'var(--text-muted)', padding: '0.4rem 1rem', fontSize: '0.8rem', cursor: 'pointer',
}}> }}>