1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 19:42:01 +02:00

Disabling auto-reconnect because it fights with the auto-timeout.

Need to find a balance between both based on real usage.
This commit is contained in:
Gunther Brunner 2014-06-30 19:35:50 +09:00
parent d7c027f2ba
commit 98148cdc7f
2 changed files with 16 additions and 11 deletions

View file

@ -3,22 +3,24 @@ module.exports = function FatalMessageServiceFactory($modal, $location, $route,
var intervalDeviceInfo
var ModalInstanceCtrl = function ($scope, $modalInstance, device) {
var ModalInstanceCtrl = function ($scope, $modalInstance, device, tryToReconnect) {
$scope.ok = function () {
$modalInstance.close(true)
$route.reload()
//$location.path('/control/' + device.serial)
}
// TODO: this is ugly, find why its not updated correctly (also on the device list)
intervalDeviceInfo = $interval(function () {
$scope.device = device
if (tryToReconnect) {
// TODO: this is ugly, find why its not updated correctly (also on the device list)
intervalDeviceInfo = $interval(function () {
$scope.device = device
if (device.usable) {
// Try to reconnect
$scope.ok()
}
}, 1000, 500)
if (device.usable) {
// Try to reconnect
$scope.ok()
}
}, 1000, 500)
}
$scope.device = device
@ -43,13 +45,16 @@ module.exports = function FatalMessageServiceFactory($modal, $location, $route,
})
}
FatalMessageService.open = function (device) {
FatalMessageService.open = function (device, tryToReconnect) {
var modalInstance = $modal.open({
template: require('./fatal-message.jade'),
controller: ModalInstanceCtrl,
resolve: {
device: function () {
return device
},
tryToReconnect: function () {
return tryToReconnect
}
}
})