瀏覽代碼

Fixed uploading icon removal code

tobychui 4 年之前
父節點
當前提交
b80247bbc9
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      web/desktop.system

+ 6 - 0
web/desktop.system

@@ -5361,6 +5361,9 @@
 
                             //Load the application icon on this file
                             let filedata = $(this).attr("filedata");
+                            if (filedata == undefined){
+                                return;
+                            }
                             filedata = JSON.parse(decodeURIComponent(filedata));
                             $.ajax({
                                 url: "system/modules/getDefault",
@@ -5714,6 +5717,7 @@
                 };
 
                 socket.onclose = function(event) {
+                    $("." + uploadingIconUUID).remove();
                     if (callback != undefined){
                         callback();
                     }
@@ -5750,6 +5754,8 @@
 
                 xhr.addEventListener('readystatechange', function(e) {
                     if (xhr.readyState == 4 && xhr.status == 200) {
+                        //Upload Succ
+                        $("." + uploadingIconUUID).remove();
                         if (callback !== undefined){
                             callback(e.target.response);
                         }