Make sure we've invited the device when we go to the control page. Refuse to show the control page on failure.

This commit is contained in:
Simo Kinnunen
2014-02-26 19:18:25 +09:00
parent be9d1c9579
commit b9cec82941
2 changed files with 15 additions and 3 deletions

View File

@@ -57,7 +57,10 @@ module.exports = function GroupServiceFactory($rootScope, $http, socket, UserSer
}
})
return tx.promise.then(function(results) {
return results[0].success
if (!results[0].success) {
throw new Error('Device refused to join the group')
}
return results[0].device
})
})
}
@@ -72,7 +75,10 @@ module.exports = function GroupServiceFactory($rootScope, $http, socket, UserSer
}
})
return tx.promise.then(function(results) {
return results[0].success
if (!results[0].success) {
throw new Error('Device refused to be kicked from the group')
}
return results[0].device
})
})
}