Skip to content

Commit bcdf770

Browse files
committed
remove expo secure storage
1 parent 817bbf4 commit bcdf770

File tree

4 files changed

+11
-34
lines changed

4 files changed

+11
-34
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,3 @@ jobs:
4343

4444
- name: Run unit tests
4545
run: npm run test
46-
47-
# - name: Run tests with coverage
48-
# run: npm run test:coverage
49-
50-
# - name: Upload coverage reports
51-
# uses: codecov/codecov-action@v3
52-
# with:
53-
# token: ${{ secrets.CODECOV_TOKEN }}
54-
# files: ./coverage/lcov.info
55-
# fail_ci_if_error: true

package-lock.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"type": "module",
23
"name": "react-autolocalise",
34
"version": "0.0.1",
45
"description": "Auto-translation SDK for React, React Native and Expo applications",
@@ -35,13 +36,11 @@
3536
},
3637
"@react-native-async-storage/async-storage": {
3738
"optional": true
38-
},
39-
"expo-secure-store": {
40-
"optional": true
4139
}
4240
},
4341
"devDependencies": {
4442
"@rollup/plugin-typescript": "^11.1.3",
43+
"tslib": "^2.6.2",
4544
"@testing-library/jest-dom": "^6.6.3",
4645
"@testing-library/react": "^14.0.0",
4746
"@testing-library/react-hooks": "^8.0.1",

src/storage/index.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,6 @@ export async function getStorageAdapter(): Promise<StorageAdapter> {
1212
global.navigator.product === "ReactNative";
1313

1414
if (isReactNative) {
15-
// Try Expo SecureStore first
16-
try {
17-
const ExpoSecureStore = await import("expo-secure-store").catch(
18-
() => null
19-
);
20-
if (ExpoSecureStore) {
21-
return {
22-
getItem: ExpoSecureStore.getItemAsync,
23-
setItem: ExpoSecureStore.setItemAsync,
24-
removeItem: ExpoSecureStore.deleteItemAsync,
25-
};
26-
}
27-
} catch (e) {
28-
// Expo SecureStore not available, try AsyncStorage
29-
}
30-
31-
// Try React Native AsyncStorage
3215
try {
3316
const AsyncStorage = await import(
3417
"@react-native-async-storage/async-storage"
@@ -41,7 +24,7 @@ export async function getStorageAdapter(): Promise<StorageAdapter> {
4124
}
4225

4326
throw new Error(
44-
"No storage adapter available. Please install either expo-secure-store or @react-native-async-storage/async-storage"
27+
"No storage adapter available. Please install @react-native-async-storage/async-storage"
4528
);
4629
}
4730

0 commit comments

Comments
 (0)