@@ -185,10 +185,10 @@ const Files: React.FC<FilesProps> = (props) => {
185
185
const [ fetchingAccelerateUploading , setFetchingAccelerateUploading ] = useState < boolean > ( false ) ;
186
186
const fetchAccelerateUploading = ( {
187
187
needFeedback,
188
- withoutCache ,
188
+ refreshCache ,
189
189
} : {
190
190
needFeedback ?: boolean ,
191
- withoutCache ?: boolean ,
191
+ refreshCache ?: boolean ,
192
192
} = { } ) => {
193
193
if ( ! currentUser || ! props . bucket || fetchingAccelerateUploading ) {
194
194
return ;
@@ -203,7 +203,7 @@ const Files: React.FC<FilesProps> = (props) => {
203
203
currentUser ,
204
204
props . bucket ?. name ,
205
205
opt ,
206
- withoutCache ,
206
+ refreshCache ,
207
207
) ;
208
208
if ( needFeedback ) {
209
209
p = toast . promise ( p , {
@@ -216,14 +216,11 @@ const Files: React.FC<FilesProps> = (props) => {
216
216
. catch ( err => LocalLogger . error ( err ) )
217
217
. finally ( ( ) => setFetchingAccelerateUploading ( false ) ) ;
218
218
} ;
219
- useEffect ( ( ) => {
220
- fetchAccelerateUploading ( ) ;
221
- } , [ currentUser ?. accessKey , props . bucket ] ) ;
222
219
const refreshCanAccelerateUploading = ( ) => {
223
220
ipcUploadManager . clearRegionsCache ( ) ;
224
221
fetchAccelerateUploading ( {
225
222
needFeedback : true ,
226
- withoutCache : true ,
223
+ refreshCache : true ,
227
224
} ) ;
228
225
} ;
229
226
@@ -285,6 +282,15 @@ const Files: React.FC<FilesProps> = (props) => {
285
282
] = useDisplayModal < { filePaths : string [ ] } > ( {
286
283
filePaths : [ ]
287
284
} ) ;
285
+ useEffect ( ( ) => {
286
+ if ( ! isShowUploadFilesConfirm ) {
287
+ return ;
288
+ }
289
+ ipcUploadManager . clearRegionsCache ( ) ;
290
+ fetchAccelerateUploading ( {
291
+ refreshCache : true ,
292
+ } ) ;
293
+ } , [ isShowUploadFilesConfirm ] ) ;
288
294
289
295
// handle upload and download
290
296
const handleUploadFiles = async ( filePaths : string [ ] ) => {
0 commit comments