]> source.dussan.org Git - gitea.git/commitdiff
Archive links: drop initial delay to three-quarters of a second
authorKyle Evans <kevans@FreeBSD.org>
Tue, 5 May 2020 21:11:37 +0000 (16:11 -0500)
committerKyle Evans <kevans@FreeBSD.org>
Tue, 5 May 2020 21:11:37 +0000 (16:11 -0500)
Some, or perhaps even most, archives will not take all that long to archive.
The archive process starts as soon as the download button is initially
clicked, so in theory they could be done quite quickly.  Drop the initial
delay down to three-quarters of a second to make it more responsive in the
common case of the archive being quickly created.

web_src/js/index.js

index 168d2a60f62e5fd3af809836f2d557372dff6c57..45237fce14d749af18d984da69b2984798cfee61 100644 (file)
@@ -746,9 +746,11 @@ function getArchive($target, url, statusUrl) {
 
         if (!xhr.responseJSON.complete && statusUrl !== null) {
           $target.closest('.dropdown').children('i').addClass('loading');
+          // Wait for only three quarters of a second initially, in case it's
+          // quickly archived.
           setTimeout(() => {
             initArchiveStatusChecker($target, url, statusUrl);
-          }, 2000);
+          }, 750);
         } else {
           // We don't need to continue checking.
           $target.closest('.dropdown').children('i').removeClass('loading');