File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
apps/web/app/s/[videoId]/_components Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -51,20 +51,22 @@ export function useUploadProgress(
5151
5252 const lastUpdated = new Date ( query . data . updatedAt ) ;
5353
54- return Date . now ( ) - lastUpdated . getTime ( ) > 5 * MINUTE
55- ? {
56- status : "failed" ,
57- lastUpdated,
58- }
59- : {
60- status : "uploading" ,
61- lastUpdated,
62- progress :
63- // `0/0` for progress is `NaN`
64- query . data . total === 0
65- ? 0
66- : ( query . data . uploaded / query . data . total ) * 100 ,
67- } ;
54+ return query . data . uploaded >= query . data . total
55+ ? null
56+ : Date . now ( ) - lastUpdated . getTime ( ) > 5 * MINUTE
57+ ? {
58+ status : "failed" ,
59+ lastUpdated,
60+ }
61+ : {
62+ status : "uploading" ,
63+ lastUpdated,
64+ progress :
65+ // `0/0` for progress is `NaN`
66+ query . data . total === 0
67+ ? 0
68+ : ( query . data . uploaded / query . data . total ) * 100 ,
69+ } ;
6870}
6971
7072const ProgressCircle = ( {
You can’t perform that action at this time.
0 commit comments