mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Add missing connection check for disconnect
This commit is contained in:
parent
9a45252a84
commit
6749b6a2df
1 changed files with 4 additions and 1 deletions
|
@ -90,7 +90,10 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
|||
fn Disconnect(&self) -> ErrorResult {
|
||||
// TODO: Step 1: Implement activeAlgorithms internal slot for BluetoothRemoteGATTServer.
|
||||
|
||||
// TODO: Step 2: Check if this.connected is false here too.
|
||||
// Step 2.
|
||||
if !self.Connected() {
|
||||
return Ok(());
|
||||
}
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.get_bluetooth_thread().send(
|
||||
BluetoothRequest::GATTServerDisconnect(String::from(self.Device().Id()), sender)).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue