mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): remove duplicate toast from RateLimitDisplay
RateLimitDisplay and RateLimitManager both showed toast notifications on reset, causing two simultaneous toasts. Remove the toast from RateLimitDisplay since RateLimitManager already handles success/error feedback with more detailed messages.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { Button } from "@/components/atoms/Button/Button";
|
||||
import { useToast } from "@/components/molecules/Toast/use-toast";
|
||||
import type { UserRateLimitResponse } from "@/app/api/__generated__/models/userRateLimitResponse";
|
||||
|
||||
function formatTokens(tokens: number): string {
|
||||
@@ -45,15 +44,11 @@ interface Props {
|
||||
|
||||
export function RateLimitDisplay({ data, onReset }: Props) {
|
||||
const [isResetting, setIsResetting] = useState(false);
|
||||
const { toast } = useToast();
|
||||
|
||||
async function handleReset() {
|
||||
setIsResetting(true);
|
||||
try {
|
||||
await onReset();
|
||||
toast({ title: "Usage reset successfully" });
|
||||
} catch (_error) {
|
||||
toast({ title: "Failed to reset usage", variant: "destructive" });
|
||||
} finally {
|
||||
setIsResetting(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user