fix: limits syncing issue (#1195)

Exposes `refreshLimits()` to be able to keep the limit in sync when
deleting/creating a document.
This commit is contained in:
emmpaz
2024-07-31 07:57:27 -05:00
committed by GitHub
parent 5582f29bda
commit 1beb434a72
4 changed files with 24 additions and 11 deletions

View File

@ -36,7 +36,7 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => {
const { toast } = useToast();
const { quota, remaining } = useLimits();
const { quota, remaining, refreshLimits } = useLimits();
const [isLoading, setIsLoading] = useState(false);
@ -71,6 +71,8 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => {
teamId: team?.id,
});
void refreshLimits();
toast({
title: 'Document uploaded',
description: 'Your document has been uploaded successfully.',