瀏覽代碼

Fixed a bug where song timer wouldn't get cancelled.

KrisVos130 9 年之前
父節點
當前提交
c4fe58fe18
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/app.js

+ 3 - 1
app/app.js

@@ -1015,7 +1015,6 @@ if (Meteor.isServer) {
         }
 
         if (Playlists.find({"songs.mid": code}).count() > 0) {
-            console.log("Code already exists!");
             return createUniqueSongId();
         } else {
             return code;
@@ -1125,6 +1124,9 @@ if (Meteor.isServer) {
         this.songTimer = function() {
             startedAt = Date.now();
 
+            if (timer !== undefined) {
+                timer.pause();
+            }
             timer = new Timer(function() {
                 _this.skipSong();
             }, songs[currentSong].duration * 1000);