This commit is contained in:
Jaco Greeff
2020-04-01 22:57:30 +02:00
committed by GitHub
parent d29edf679e
commit 7428ef8eb7
8 changed files with 317 additions and 778 deletions
+2
View File
@@ -79,8 +79,10 @@ export default function App (): React.ReactElement<{}> | null {
} catch (e) {
console.log('Error loading keyring ', e);
}
await globalAny.localStorage.init();
await cryptoWaitReady();
setReady(true);
_onClickNew();
};
+1 -1
View File
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const getWorkspaces = require('get-yarn-workspaces');
const workspaces = getWorkspaces(__dirname).filter((item) =>
path.normalize(item) !== path.normalize(__dirname)
);
let workspacesBuildDirs = workspaces.map((workspace) => path.join(workspace, 'build/'));
workspacesBuildDirs = workspacesBuildDirs.filter((item) => item !== path.join(__dirname, '../reactnative-identicon/build/'));
module.exports = {
@@ -15,8 +15,10 @@ class Storage {
init = async () => {
const keys = await AsyncStorage.getAllKeys();
const data = await AsyncStorage.multiGet(keys);
data.forEach(this.saveItem.bind(this));
this.loading = false;
return [...data];
}
@@ -26,11 +28,13 @@ class Storage {
setItem = (key, value) => {
this.dataMap.set(key, value);
return AsyncStorage.setItem(key, value);
}
remove = (key) => {
this.dataMap.delete(key);
return AsyncStorage.removeItem(key);
}