Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit c7a299b

Browse files
rubina-shakhkyanRubina
andauthored
fix: add compatibility with hermes engine
* Replace nativeApis map with an object * Remove toLocaleLowercase to make it compatible with hermes engine * Update rnsensors.js * Update sensors.js Co-authored-by: Rubina <rubina.shakkyan@gmail.com>
1 parent 1aa96c9 commit c7a299b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/rnsensors.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const nativeApis = new Map([
2525
const availableSensors = {};
2626

2727
export function start(type) {
28-
const api = nativeApis.get(type.toLocaleLowerCase());
28+
const api = nativeApis.get(type);
2929
api.startUpdates();
3030
}
3131

@@ -34,24 +34,24 @@ export function isAvailable(type) {
3434
return availableSensors[type];
3535
}
3636

37-
const api = nativeApis.get(type.toLocaleLowerCase());
37+
const api = nativeApis.get(type);
3838
const promise = api.isAvailable();
3939
availableSensors[type] = promise;
4040

4141
return promise;
4242
}
4343

4444
export function stop(type) {
45-
const api = nativeApis.get(type.toLocaleLowerCase());
45+
const api = nativeApis.get(type);
4646
api.stopUpdates();
4747
}
4848

4949
export function setUpdateInterval(type, updateInterval) {
50-
const api = nativeApis.get(type.toLocaleLowerCase());
50+
const api = nativeApis.get(type);
5151
api.setUpdateInterval(updateInterval);
5252
}
5353

5454
export function setLogLevelForType(type, level) {
55-
const api = nativeApis.get(type.toLocaleLowerCase());
55+
const api = nativeApis.get(type);
5656
api.setLogLevel(level);
5757
}

0 commit comments

Comments
 (0)