forked from syntaxbullet/aurorabot
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:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user