Skip to content

Commit

Permalink
Check
Browse files Browse the repository at this point in the history
  • Loading branch information
zfir committed Jun 26, 2024
1 parent 2950af2 commit fa115c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ios/CDVRoomPlan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CDVRoomPlan: CDVPlugin, RoomCaptureSessionDelegate, RoomCaptureViewDelegat
self.activityIndicator?.stopAnimating()
stopSession()
roomCaptureView.removeFromSuperview()
NotificationCenter.default.removeObserver(self)
NotificationCenter.default.removeObserver(self)
}

@objc func doneScanning(_ sender: UIButton) {
Expand All @@ -107,11 +107,11 @@ class CDVRoomPlan: CDVPlugin, RoomCaptureSessionDelegate, RoomCaptureViewDelegat
}

@objc func cancelScanning(_ sender: UIButton) {
dismissCaptureView()
let result = ["message": "Scanning cancelled"]
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: result)
pluginResult?.keepCallback = true
self.commandDelegate.send(pluginResult, callbackId: self.command.callbackId)
dismissCaptureView()
}

func exportResults() {
Expand All @@ -130,6 +130,11 @@ class CDVRoomPlan: CDVPlugin, RoomCaptureSessionDelegate, RoomCaptureViewDelegat
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: result)
pluginResult?.keepCallback = true
self.commandDelegate.send(pluginResult, callbackId: self.command.callbackId)
} else {
let result = ["message": "No data captured"]
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: result)
pluginResult?.keepCallback = true
self.commandDelegate.send(pluginResult, callbackId: self.command.callbackId)
}
} catch {
let result = ["message": "Error exporting results"]
Expand Down

0 comments on commit fa115c5

Please sign in to comment.