Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign up + LockScreen #28

Merged
merged 20 commits into from
Aug 9, 2018
Merged

Sign up + LockScreen #28

merged 20 commits into from
Aug 9, 2018

Conversation

brunobar79
Copy link
Contributor

@brunobar79 brunobar79 commented Aug 7, 2018

Description
This PR relates to account creation and listing.

  • User password stored in the keychain and can be unlocked with FaceId / TouchId / Device Pin code
  • Autolock the app once the app enters into background mode
  • Unlock keychain when the app goes into foreground
  • Vault creation
  • Login
  • Account listing
  • Add account

DEMO:

accounts

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

Issue

@brunobar79 brunobar79 changed the title [DO NOT MERGE] - Sign up + LockScreen Sign up + LockScreen Aug 8, 2018
@brunobar79 brunobar79 requested a review from bitpshr August 8, 2018 04:55
Copy link
Contributor

@bitpshr bitpshr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Very clean PR, mostly nit comments. Nothing should hold this up, so I'll approve. Feel free to fix or not fix these comments.

onAccountChange = async newIndex => {
try {
this.setState({ selectedAccountIndex: newIndex });
await Engine.api.preferences.update({ selectedAddress: Object.keys(this.props.accounts)[newIndex] });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry about the order of these operations. I understand we're updating the UI instantly for speed then calling the background update, but maybe we should revert the UI to the previous address in the catch. That way we don't run the risk of this component's selectedAccountIndex getting out of sync with the preference controller's selectedAddress.

Whatever we decide, I think this should be a pattern throughout when interacting with the Engine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a good call. I feel like we should do this everywhere

addAccount = async () => {
try {
await Engine.api.keyring.addNewAccount();
this.setState({ selectedAccountIndex: Object.keys(this.props.accounts).length - 1 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment re: catching & reverting when interacting with the engine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case isn't necessary because if the engine blows up it will never change the index.

}
};

accountSettings = () => false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we name this so it's obvious it's a method? openAccountSettings or something similar?

icon: {
height: 50,
width: 10,
backgroundColor: colors.concrete
}
});

/**
* View contains the list of all the available accounts
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I don't think components can have a newline between the component description and the class for documentation generation. Not 100% sure, but that's been the case in the past.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shit, I've been doing this all over the place!

import Main from '../Main';
import AccountList from '../AccountList';

import Engine from '../../core/Engine';
/**
* Root application component responsible for instantiating
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we update this to be more descriptive of the conditional rendering logic and move this description to the exported class, not the Nav component?


_decryptWithKey = (encryptedData, key) => Aes.decrypt(encryptedData.cipher, key, encryptedData.iv);

encrypt = async (password, object) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document this since it's public?

return JSON.stringify(result);
};

decrypt = async (password, encryptedString) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document this since it's public?

import { NativeModules } from 'react-native';
const Aes = NativeModules.Aes;

export default class Encryptor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a simple description to this class?


/**
* Core controller responsible for composing other GABA controllers together
* and exposing convenience methods for common wallet operations.
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we move this description to right above the Engine class? Otherwise documentation may get generated incorrectly.

shim.js Outdated
@@ -1,3 +1,5 @@
import {decode, encode} from 'base-64'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's chat as to why this needs to be included int the repo (if it's generated at least; if it's not generated, we should format it and lint it properly.) Not a big deal, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you move the lines 1-15 out of the shim.js to the./ index.js you'll see you get an error: self is not defined. I think it's related to the way "import" works.

sethkfman pushed a commit that referenced this pull request Sep 3, 2021
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](mikaelbr/node-notifier@v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
rickycodes pushed a commit that referenced this pull request Jan 31, 2022
* ready to create accounts

* account generation working

* added login screen

* avoid setstate when unmounted

* clean up

* more clean up

* account list using real addresses

* account list using real addresses

* clean up

* update tests

* clean up

* fix android builds

* android and ios are working

* android view looking good

* UI refactor

* code review stuff

* update

* more code review stuff
legobeat added a commit that referenced this pull request May 13, 2024
@legobeat legobeat mentioned this pull request May 13, 2024
7 tasks
legobeat added a commit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants