-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix fake-expo-secure-store etc (#4220)
* init fix * remove fake-expo-secure-store
- Loading branch information
Showing
6 changed files
with
41 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,10 @@ | ||
import RNAsyncStorage from "@react-native-async-storage/async-storage"; | ||
|
||
interface SecureDB { | ||
get: (key: string) => Promise<any>; | ||
set: (key: string, value: any) => Promise<void>; | ||
remove: (key: string) => Promise<void>; | ||
reset: () => Promise<void>; | ||
} | ||
|
||
export class SecureStorage implements SecureDB { | ||
async get(key: string): Promise<string | null> { | ||
console.log("z1:native.ts:getItem"); | ||
// @ts-ignore | ||
return RNAsyncStorage.getItem(key); | ||
} | ||
|
||
async set(key: string, value: string): Promise<void> { | ||
console.log("z1:native.ts:setItem"); | ||
// @ts-ignore | ||
return RNAsyncStorage.setItem(key, value); | ||
} | ||
|
||
async remove(key: string): Promise<void> { | ||
// @ts-ignore | ||
return RNAsyncStorage.removeItem(key); | ||
} | ||
|
||
async reset(): Promise<void> { | ||
// @ts-ignore | ||
return RNAsyncStorage.clear(); | ||
} | ||
} | ||
const AsyncStorage = { | ||
getItem: (key: string) => RNAsyncStorage.getItem(key), | ||
setItem: (key: string, value: any) => RNAsyncStorage.setItem(key, value), | ||
removeItem: (key: string) => RNAsyncStorage.removeItem(key), | ||
clear: () => RNAsyncStorage.clear(), | ||
}; | ||
|
||
export default AsyncStorage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,17 @@ | ||
// NOTE this is just a stub for the native AsyncStorage wrapper | ||
interface SecureDB { | ||
get: (key: string) => Promise<any>; | ||
set: (key: string, value: any) => Promise<void>; | ||
remove: (key: string) => Promise<void>; | ||
reset: () => Promise<void>; | ||
} | ||
// interface S { | ||
// getItem: (key: string) => Promise<any>; | ||
// setItem: (key: string, value: any) => Promise<void>; | ||
// removeItem: (key: string) => Promise<void>; | ||
// clear: () => Promise<void>; | ||
// } | ||
|
||
export class SecureStorage implements SecureDB { | ||
async get(key: string): Promise<string | null> { | ||
console.log("z1:web.ts:getItem"); | ||
return localStorage.getItem(key); | ||
} | ||
const AsyncStorage = { | ||
getItem: (key: string) => Promise.resolve(localStorage.getItem(key)), | ||
setItem: (key: string, value: any) => | ||
Promise.resolve(localStorage.setItem(key, value)), | ||
removeItem: (key: string) => Promise.resolve(localStorage.removeItem(key)), | ||
clear: () => Promise.resolve(localStorage.clear()), | ||
}; | ||
|
||
async set(key: string, value: string): Promise<void> { | ||
console.log("z1:web.ts:setItem"); | ||
return localStorage.setItem(key, value); | ||
} | ||
|
||
async remove(key: string): Promise<void> { | ||
return localStorage.removeItem(key); | ||
} | ||
|
||
async reset(): Promise<void> { | ||
return localStorage.clear(); | ||
} | ||
} | ||
export default AsyncStorage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9b1dd91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
backpack – ./
backpack-200ms.vercel.app
devnet.backpack.app
www.backpack.app
backpack-git-master-200ms.vercel.app
backpack.app