From b6a81df776a78540960ce0ad858b11d218e40f73 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Fri, 4 Apr 2014 18:20:53 +0900 Subject: [PATCH] Probably fix "using" issues. --- res/app/components/stf/device/device-service.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/res/app/components/stf/device/device-service.js b/res/app/components/stf/device/device-service.js index 52a63ec9..f4204a81 100644 --- a/res/app/components/stf/device/device-service.js +++ b/res/app/components/stf/device/device-service.js @@ -25,6 +25,11 @@ module.exports = function DeviceServiceFactory($rootScope, $http, socket) { data.usable = data.present && data.status === 3 && data.ready && (!data.owner || data.using) + // Make sure we don't mistakenly think we still have the device + if (!data.usable) { + data.using = false + } + // For convenience, formulate an aggregate state property that covers // every possible state. data.state = 'absent'