Skip to content

Commit

Permalink
refactor(data-device): merge both cases in leave
Browse files Browse the repository at this point in the history
Co-authored-by: Kirill Chibisov <[email protected]>
  • Loading branch information
wash2 and kchibisov authored Sep 22, 2023
1 parent 251321d commit d0812fd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/data_device_manager/data_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,12 @@ impl DataOfferData {
pub(crate) fn leave(&self) -> bool {
let mut inner = self.inner.lock().unwrap();
match &mut inner.deref_mut().offer {
DataDeviceOffer::Drag(o) if o.dropped => {
o.left = true;
false
}
DataDeviceOffer::Drag(o) if !o.dropped => {
DataDeviceOffer::Drag(o) => {
o.left = true;
o.data_offer.destroy();
true
if !o.dropped {
o.data_offer.destroy();
}
!o.dropped
}
_ => {
warn!("DataDeviceOffer::leave called on non-drag offer");
Expand Down

0 comments on commit d0812fd

Please sign in to comment.