scandit-react-native-datacapture-core 7.6.0-beta.1 → 7.6.0

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.
@@ -68,7 +68,7 @@ if (file( "${rootProject.projectDir}/build-test.gradle").exists()) {
68
68
  }
69
69
 
70
70
  dependencies {
71
- def sdk_version = "7.6.0-beta.1"
71
+ def sdk_version = "7.6.0"
72
72
 
73
73
  println("Version of the native sdk used in this build: ${safeExtGet('global_sdk_version', sdk_version)}")
74
74
  if (findProject(':scandit-datacapture-frameworks-core') != null) {
@@ -109,7 +109,7 @@ class ScanditDataCaptureCoreModule(
109
109
  }
110
110
 
111
111
  @ReactMethod
112
- fun dispose() {
112
+ fun disposeContext() {
113
113
  coreModule.disposeContext()
114
114
  }
115
115
 
package/dist/core.js CHANGED
@@ -2238,46 +2238,45 @@ class DataCaptureContext extends DefaultSerializeable {
2238
2238
  this.controller.unsubscribeListener();
2239
2239
  }
2240
2240
  }
2241
- /**
2242
- * @deprecated Since 7.6.
2243
- * Use setMode() instead. DataCaptureContext does not support multiple modes at the same time.
2244
- */
2245
2241
  addMode(mode) {
2246
2242
  this.addModeInternal(mode);
2247
2243
  }
2248
2244
  setMode(mode) {
2249
- if (this.modes.length > 0) {
2250
- this.removeAllModes();
2251
- }
2245
+ this.removeAllModes();
2252
2246
  this.addModeInternal(mode);
2253
2247
  }
2254
2248
  addModeInternal(mode) {
2255
2249
  if (!this.modes.includes(mode)) {
2256
2250
  this.modes.push(mode);
2257
- mode._context = this;
2258
2251
  this.controller.addModeToContext(mode);
2252
+ mode._context = this;
2259
2253
  }
2260
2254
  }
2261
2255
  removeCurrentMode() {
2262
- if (this.modes.length > 0) {
2263
- this.removeModeInternal(this.modes[0]);
2256
+ if (this.modes.length === 0) {
2257
+ return;
2264
2258
  }
2259
+ if (this.modes.length > 1) {
2260
+ console.warn('removeCurrentMode() called with multiple modes active. Consider using removeMode() for specific mode removal. Only the first mode will be removed.');
2261
+ }
2262
+ this.removeModeInternal(this.modes[0]);
2265
2263
  }
2266
- /**
2267
- * @deprecated Since 7.6.
2268
- * Use removeCurrentMode() instead.
2269
- */
2270
2264
  removeMode(mode) {
2271
2265
  this.removeModeInternal(mode);
2272
2266
  }
2273
2267
  removeModeInternal(mode) {
2274
- if (this.modes.includes(mode)) {
2275
- this.modes.splice(this.modes.indexOf(mode), 1);
2276
- mode._context = null;
2277
- this.controller.removeModeFromContext(mode);
2278
- }
2268
+ return __awaiter(this, void 0, void 0, function* () {
2269
+ if (this.modes.includes(mode)) {
2270
+ this.modes.splice(this.modes.indexOf(mode), 1);
2271
+ mode._context = null;
2272
+ this.controller.removeModeFromContext(mode);
2273
+ }
2274
+ });
2279
2275
  }
2280
2276
  removeAllModes() {
2277
+ if (this.modes.length === 0) {
2278
+ return;
2279
+ }
2281
2280
  this.modes.forEach(mode => {
2282
2281
  mode._context = null;
2283
2282
  });