bittorrenttorque / btapp

Btapp.js is a backbone library that provides easy access to Torque/BitTorrent/uTorrent clients.
http://documentup.com/bittorrenttorque/btapp
783 stars 73 forks source link

btapp.on('add:add' function(add){add.torrnet} not works #5

Closed arestov closed 12 years ago

arestov commented 12 years ago
var btapp = new Btapp();

btapp.on('add:add', function(add){
    console.log( typeof add.torrent ) 
};
//undefined

so add.torrent({...}) no works, but

var btapp = new Btapp();

btapp.on('add:add', function(add){
    setTimeout(function() {
        add.torrent({...})
    });
};

works fine

pwmckenna commented 12 years ago

uh oh...this was an unintended consequence of making the backbone tree creation asynchronous (which was to fix an issue that i've solved on the client side instead). pushing a fix now to btapp.js...you'll have to update your submodule if you're doing it that way.