fix(ui): StartupLogPanel — defensive scrollTo + disable buttons while fetching
This commit is contained in:
@@ -24,7 +24,7 @@ export function StartupLogPanel({ deployment, appSlug, envSlug, className }: Sta
|
||||
|
||||
const scrollToLatest = () => {
|
||||
const el = scrollRef.current;
|
||||
if (!el) return;
|
||||
if (!el || typeof el.scrollTo !== 'function') return;
|
||||
// asc → latest at bottom; desc → latest at top
|
||||
const top = sort === 'asc' ? el.scrollHeight : 0;
|
||||
el.scrollTo({ top, behavior: 'smooth' });
|
||||
@@ -57,6 +57,7 @@ export function StartupLogPanel({ deployment, appSlug, envSlug, className }: Sta
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={query.isFetching}
|
||||
onClick={() => setSort((s) => (s === 'asc' ? 'desc' : 'asc'))}
|
||||
title={sort === 'asc' ? 'Oldest first' : 'Newest first'}
|
||||
aria-label={sort === 'asc' ? 'Oldest first' : 'Newest first'}
|
||||
@@ -66,6 +67,7 @@ export function StartupLogPanel({ deployment, appSlug, envSlug, className }: Sta
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={query.isFetching}
|
||||
onClick={handleRefresh}
|
||||
title="Refresh"
|
||||
aria-label="Refresh"
|
||||
|
||||
Reference in New Issue
Block a user