Explorar o código

fix notice not display when error event triggered

DIYgod %!s(int64=7) %!d(string=hai) anos
pai
achega
bad2200611
Modificáronse 1 ficheiros con 6 adicións e 4 borrados
  1. 6 4
      src/js/player.js

+ 6 - 4
src/js/player.js

@@ -545,10 +545,12 @@ class DPlayer {
             clearTimeout(this.noticeTime);
         }
         this.events.trigger('notice_show', text);
-        this.noticeTime = setTimeout(() => {
-            this.template.notice.style.opacity = 0;
-            this.events.trigger('notice_hide');
-        }, time);
+        if (time > 0) {
+            this.noticeTime = setTimeout(() => {
+                this.template.notice.style.opacity = 0;
+                this.events.trigger('notice_hide');
+            }, time);
+        }
     }
 
     resize () {