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": {
"@babel/core": "^7.9.0",
"@babel/runtime": "^7.9.2",
"@polkadot/dev": "^0.52.3",
"@polkadot/dev": "^0.52.4",
"@polkadot/ts": "^0.3.14",
"@types/jest": "^25.1.4",
"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]
);
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 => {
_onClickNew();
+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);
}
+1
View File
@@ -17,6 +17,7 @@ interface Props extends BaseProps {
}
const DEFAULT_DELAY = 150;
const DEFAULT_ERROR = (error: Error): void => {
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) {
this._store.remove(key);
return;
}
+300 -773
View File
File diff suppressed because it is too large Load Diff