From fa115c5197f476298fc201aea94a0312ac585157 Mon Sep 17 00:00:00 2001 From: Zafir Sk Heerah Date: Wed, 26 Jun 2024 16:00:20 +0400 Subject: [PATCH] Check --- src/ios/CDVRoomPlan.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ios/CDVRoomPlan.swift b/src/ios/CDVRoomPlan.swift index 70e156b..cd251f1 100644 --- a/src/ios/CDVRoomPlan.swift +++ b/src/ios/CDVRoomPlan.swift @@ -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) { @@ -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() { @@ -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"]