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
+1 -1
View File
@@ -32,7 +32,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.9.0", "@babel/core": "^7.9.0",
"@babel/runtime": "^7.9.2", "@babel/runtime": "^7.9.2",
"@polkadot/dev": "^0.52.3", "@polkadot/dev": "^0.52.4",
"@polkadot/ts": "^0.3.14", "@polkadot/ts": "^0.3.14",
"@types/jest": "^25.1.4", "@types/jest": "^25.1.4",
"babel-plugin-transform-vue-template": "^0.4.2", "babel-plugin-transform-vue-template": "^0.4.2",
+7 -3
View File
@@ -34,9 +34,13 @@ function App ({ className }: Props): React.ReactElement<Props> | null {
}, },
[ss58Format] [ss58Format]
); );
const _onChangeSS58Format = ({ currentTarget: { value } }: React.SyntheticEvent<HTMLSelectElement>): void => {
setSS58Format(parseInt(value, 10)); const _onChangeSS58Format = useCallback(
}; ({ currentTarget: { value } }: React.SyntheticEvent<HTMLSelectElement>): void => {
setSS58Format(parseInt(value, 10));
},
[]
);
useEffect((): void => { useEffect((): void => {
_onClickNew(); _onClickNew();
+2
View File
@@ -79,8 +79,10 @@ export default function App (): React.ReactElement<{}> | null {
} catch (e) { } catch (e) {
console.log('Error loading keyring ', e); console.log('Error loading keyring ', e);
} }
await globalAny.localStorage.init(); await globalAny.localStorage.init();
await cryptoWaitReady(); await cryptoWaitReady();
setReady(true); setReady(true);
_onClickNew(); _onClickNew();
}; };
+1 -1
View File
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path'); const path = require('path');
const getWorkspaces = require('get-yarn-workspaces'); const getWorkspaces = require('get-yarn-workspaces');
const workspaces = getWorkspaces(__dirname).filter((item) => const workspaces = getWorkspaces(__dirname).filter((item) =>
path.normalize(item) !== path.normalize(__dirname) path.normalize(item) !== path.normalize(__dirname)
); );
let workspacesBuildDirs = workspaces.map((workspace) => path.join(workspace, 'build/')); let workspacesBuildDirs = workspaces.map((workspace) => path.join(workspace, 'build/'));
workspacesBuildDirs = workspacesBuildDirs.filter((item) => item !== path.join(__dirname, '../reactnative-identicon/build/')); workspacesBuildDirs = workspacesBuildDirs.filter((item) => item !== path.join(__dirname, '../reactnative-identicon/build/'));
module.exports = { module.exports = {
@@ -15,8 +15,10 @@ class Storage {
init = async () => { init = async () => {
const keys = await AsyncStorage.getAllKeys(); const keys = await AsyncStorage.getAllKeys();
const data = await AsyncStorage.multiGet(keys); const data = await AsyncStorage.multiGet(keys);
data.forEach(this.saveItem.bind(this)); data.forEach(this.saveItem.bind(this));
this.loading = false; this.loading = false;
return [...data]; return [...data];
} }
@@ -26,11 +28,13 @@ class Storage {
setItem = (key, value) => { setItem = (key, value) => {
this.dataMap.set(key, value); this.dataMap.set(key, value);
return AsyncStorage.setItem(key, value); return AsyncStorage.setItem(key, value);
} }
remove = (key) => { remove = (key) => {
this.dataMap.delete(key); this.dataMap.delete(key);
return AsyncStorage.removeItem(key); return AsyncStorage.removeItem(key);
} }
+1
View File
@@ -17,6 +17,7 @@ interface Props extends BaseProps {
} }
const DEFAULT_DELAY = 150; const DEFAULT_DELAY = 150;
const DEFAULT_ERROR = (error: Error): void => { const DEFAULT_ERROR = (error: Error): void => {
console.error('@polkadot/react-qr:Scan', error.message); console.error('@polkadot/react-qr:Scan', error.message);
}; };
+1
View File
@@ -177,6 +177,7 @@ export class Keyring extends Base implements KeyringStruct {
if (isRecent && (Date.now() - whenCreated) > RECENT_EXPIRY) { if (isRecent && (Date.now() - whenCreated) > RECENT_EXPIRY) {
this._store.remove(key); this._store.remove(key);
return; return;
} }
+300 -773
View File
File diff suppressed because it is too large Load Diff