Ver Fonte

Fixed minor glitch for File Manager hash refresh

Toby Chui há 3 anos atrás
pai
commit
f5636d843c
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      web/SystemAO/file_system/file_explorer.html

+ 3 - 2
web/SystemAO/file_system/file_explorer.html

@@ -1317,13 +1317,14 @@
                     if (enableAutoRefresh == false){
                         return;
                     }
+                    let currentPagePath = currentPath;
                     getDirHash(function(hash){
                         if (hash.error !== undefined){
                             //Something went wrong. Ignore this request
                             console.log(hash.error)
                         }else{
-                            //Check if the hash match with the last hash.
-                            if (hash != currentPathHash){
+                            //Check if the hash match with the last hash && user is still on the same page
+                            if (hash != currentPathHash && currentPagePath == currentPath){
                                 //console.log(currentPathHash, hash);
                                 refreshList();
                                 currentPathHash = hash;