mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +02:00
Tell the UI why the device became unusable.
This commit is contained in:
@@ -72,7 +72,7 @@ module.exports = syrup.serial()
|
||||
}
|
||||
}
|
||||
|
||||
plugin.leave = function() {
|
||||
plugin.leave = function(reason) {
|
||||
return plugin.get()
|
||||
.then(function(group) {
|
||||
log.important('No longer owned by "%s"', group.email)
|
||||
@@ -86,6 +86,7 @@ module.exports = syrup.serial()
|
||||
, wireutil.envelope(new wire.LeaveGroupMessage(
|
||||
options.serial
|
||||
, group
|
||||
, reason
|
||||
))
|
||||
])
|
||||
|
||||
@@ -136,7 +137,7 @@ module.exports = syrup.serial()
|
||||
var reply = wireutil.reply(options.serial)
|
||||
grouputil.match(ident, message.requirements)
|
||||
.then(function() {
|
||||
return plugin.leave()
|
||||
return plugin.leave('ungroup_request')
|
||||
})
|
||||
.then(function() {
|
||||
push.send([
|
||||
@@ -154,12 +155,12 @@ module.exports = syrup.serial()
|
||||
|
||||
channels.on('timeout', function(channel) {
|
||||
if (currentGroup && channel === currentGroup.group) {
|
||||
plugin.leave()
|
||||
plugin.leave('automatic_timeout')
|
||||
}
|
||||
})
|
||||
|
||||
lifecycle.observe(function() {
|
||||
return plugin.leave()
|
||||
return plugin.leave('lifecycle_ended')
|
||||
.catch(grouputil.NoGroupError, function() {
|
||||
return true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user