Browse Source

Fixed SoundCloud song playing on Dashboard bug.

KrisVos130 9 years ago
parent
commit
529e728269
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/app.js

+ 5 - 1
app/app.js

@@ -13,6 +13,7 @@ if (Meteor.isClient) {
 
     Meteor.subscribe("queues");
 
+    var minterval;
     var hpSound = undefined;
     var songsArr = [];
     var ytArr = [];
@@ -190,6 +191,9 @@ if (Meteor.isClient) {
 
     Template.dashboard.onCreated(function() {
         if (_sound !== undefined) _sound.stop();
+        if (minterval !== undefined) {
+            Meteor.clearInterval(minterval);
+        }
         Meteor.subscribe("history");
     });
 
@@ -647,7 +651,7 @@ if (Meteor.isClient) {
                 window.location = "/";
             } else {
                 Session.set("loaded", true);
-                Meteor.setInterval(function () {
+                minterval = Meteor.setInterval(function () {
                     var data = undefined;
                     var dataCursorH = History.find({type: type});
                     var dataCursorP = Playlists.find({type: type});