fix: (web) fix refresh icon spinning indefinitely

- Remove redundant isRefreshing state
- Icon spin is controlled by isLoading prop from parent
- Parent correctly manages loading state during fetch
This commit is contained in:
syntaxbullet
2026-01-16 15:20:36 +01:00
parent d117bcb697
commit 7d658bbef9

View File

@@ -212,13 +212,6 @@ function QuestTableContent({ quests }: { quests: QuestListItem[] }) {
}
export function QuestTable({ quests, isLoading, onRefresh }: QuestTableProps) {
const [isRefreshing, setIsRefreshing] = React.useState(false);
const handleRefresh = async () => {
setIsRefreshing(true);
onRefresh?.();
};
return (
<Card className="glass-card overflow-hidden">
<CardHeader className="pb-3">
@@ -235,11 +228,11 @@ export function QuestTable({ quests, isLoading, onRefresh }: QuestTableProps) {
</Badge>
)}
<button
onClick={handleRefresh}
disabled={isRefreshing}
onClick={onRefresh}
disabled={isLoading}
className={cn(
"p-2 rounded-md hover:bg-muted/50 transition-colors",
isRefreshing && "cursor-wait"
isLoading && "cursor-wait"
)}
title="Refresh quests"
>
@@ -255,7 +248,7 @@ export function QuestTable({ quests, isLoading, onRefresh }: QuestTableProps) {
strokeLinejoin="round"
className={cn(
"text-muted-foreground transition-transform",
isRefreshing && "animate-spin"
isLoading && "animate-spin"
)}
>
<path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />