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:
Zamil Majdy
2026-03-26 09:15:21 +07:00
parent e7542d4433
commit 925830de5a

View File

@@ -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);
}