mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 00:53:26 +02:00
Show upload/processing progress for normal file uploads.
This commit is contained in:
@@ -188,6 +188,25 @@ module.exports = function TransactionServiceFactory(socket) {
|
||||
}
|
||||
}
|
||||
|
||||
transactionService.punch = function(channel) {
|
||||
var resolver = Promise.defer()
|
||||
|
||||
function punchListener(someChannel) {
|
||||
if (channel === someChannel) {
|
||||
resolver.resolve(channel)
|
||||
}
|
||||
}
|
||||
|
||||
socket.on('tx.punch', punchListener)
|
||||
socket.emit('tx.punch', channel)
|
||||
|
||||
return resolver.promise
|
||||
.timeout(5000)
|
||||
.finally(function() {
|
||||
socket.removeListener('tx.punch', punchListener)
|
||||
})
|
||||
}
|
||||
|
||||
transactionService.TransactionResult = TransactionResult
|
||||
|
||||
return transactionService
|
||||
|
||||
Reference in New Issue
Block a user