react-native-ota-hot-update 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -543,10 +543,10 @@ class OtaHotUpdateModule internal constructor(context: ReactApplicationContext)
|
|
|
543
543
|
path: String?,
|
|
544
544
|
base64Content: String?,
|
|
545
545
|
encoding: String?,
|
|
546
|
-
promise: Promise
|
|
546
|
+
promise: Promise
|
|
547
547
|
) {
|
|
548
548
|
if (path == null || base64Content == null) {
|
|
549
|
-
promise
|
|
549
|
+
promise.reject("INVALID_ARG", "Path and base64Content are required", null)
|
|
550
550
|
return
|
|
551
551
|
}
|
|
552
552
|
|
|
@@ -570,15 +570,15 @@ class OtaHotUpdateModule internal constructor(context: ReactApplicationContext)
|
|
|
570
570
|
|
|
571
571
|
// Resolve on UI thread (React Native requirement)
|
|
572
572
|
UiThreadUtil.runOnUiThread {
|
|
573
|
-
promise
|
|
573
|
+
promise.resolve(true)
|
|
574
574
|
}
|
|
575
575
|
} catch (e: IOException) {
|
|
576
576
|
UiThreadUtil.runOnUiThread {
|
|
577
|
-
promise
|
|
577
|
+
promise.reject("WRITE_ERROR", "Failed to write file: ${e.message}", e)
|
|
578
578
|
}
|
|
579
579
|
} catch (e: Exception) {
|
|
580
580
|
UiThreadUtil.runOnUiThread {
|
|
581
|
-
promise
|
|
581
|
+
promise.reject("WRITE_ERROR", "Unexpected error: ${e.message}", e)
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
}
|