Skip to content

Commit

Permalink
Merge branch 'unit-test-fix' of https://github.com/powerful23/aws-amp…
Browse files Browse the repository at this point in the history
…lify into unit-test-fix
  • Loading branch information
powerful23 committed Aug 17, 2018
2 parents 25f4c81 + 26ebdcb commit 9336538
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 13 deletions.
8 changes: 8 additions & 0 deletions packages/amazon-cognito-identity-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="2.0.22-unstable.1"></a>
## [2.0.22-unstable.1](https://github.com/aws/aws-amplify/compare/amazon-cognito-identity-js@[email protected]) (2018-08-16)




**Note:** Version bump only for package amazon-cognito-identity-js

<a name="2.0.22-unstable.0"></a>
## [2.0.22-unstable.0](https://github.com/aws/aws-amplify/compare/[email protected]@2.0.22-unstable.0) (2018-08-15)

Expand Down
2 changes: 1 addition & 1 deletion packages/amazon-cognito-identity-js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "amazon-cognito-identity-js",
"description": "Amazon Cognito Identity Provider JavaScript SDK",
"version": "2.0.22-unstable.0",
"version": "2.0.22-unstable.1",
"author": {
"name": "Amazon Web Services",
"email": "[email protected]",
Expand Down
8 changes: 8 additions & 0 deletions packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="1.0.7-unstable.1"></a>
## [1.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2018-08-16)




**Note:** Version bump only for package @aws-amplify/api

<a name="1.0.7-unstable.0"></a>
## [1.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2018-08-15)

Expand Down
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/api",
"version": "1.0.7-unstable.0",
"version": "1.0.7-unstable.1",
"description": "Api category of aws-amplify",
"main": "./lib/index.js",
"module": "./lib/index.js",
Expand Down Expand Up @@ -50,7 +50,7 @@
"webpack": "^3.5.5"
},
"dependencies": {
"@aws-amplify/auth": "^1.0.7-unstable.0",
"@aws-amplify/auth": "^1.0.7-unstable.1",
"@aws-amplify/cache": "^1.0.5",
"@aws-amplify/core": "^1.0.5",
"@types/zen-observable": "^0.5.3",
Expand Down
8 changes: 8 additions & 0 deletions packages/auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="1.0.7-unstable.1"></a>
## [1.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2018-08-16)




**Note:** Version bump only for package @aws-amplify/auth

<a name="1.0.7-unstable.0"></a>
## [1.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2018-08-15)

Expand Down
4 changes: 2 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/auth",
"version": "1.0.7-unstable.0",
"version": "1.0.7-unstable.1",
"description": "Auth category of aws-amplify",
"main": "./lib/index.js",
"module": "./lib/index.js",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@aws-amplify/cache": "^1.0.5",
"@aws-amplify/core": "^1.0.5",
"amazon-cognito-auth-js": "^1.1.9",
"amazon-cognito-identity-js": "^2.0.22-unstable.0"
"amazon-cognito-identity-js": "^2.0.22-unstable.1"
},
"jest": {
"transform": {
Expand Down
11 changes: 11 additions & 0 deletions packages/aws-amplify-react-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="1.0.7-unstable.1"></a>
## [1.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react-native@[email protected]) (2018-08-16)


### Bug Fixes

* **aws-amplify-react-native:** fix the Authenticator to only call async functions when mounted ([8352bdb](https://github.com/aws/aws-amplify/commit/8352bdb))




<a name="1.0.7-unstable.0"></a>
## [1.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/[email protected]@1.0.7-unstable.0) (2018-08-15)

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-amplify-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-amplify-react-native",
"version": "1.0.7-unstable.0",
"version": "1.0.7-unstable.1",
"description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.",
"main": "dist/index.js",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"rimraf": "^2.6.2"
},
"dependencies": {
"aws-amplify": "^1.0.7-unstable.0",
"aws-amplify": "^1.0.7-unstable.1",
"axios": "^0.17.1",
"babel-preset-es2015": "^6.24.1"
},
Expand Down
10 changes: 9 additions & 1 deletion packages/aws-amplify-react-native/src/Auth/Authenticator.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,23 @@ export default class Authenticator extends React.Component {
Hub.listen('auth', this);
}

componentWillMount() {
componentDidMount() {
this._isMounted = true;
this.checkUser();
}

componentWillUnmount() {
this._isMounted = false;
}

onHubCapsule(capsule) {
const { channel, payload, source } = capsule;
if (channel === 'auth') { this.checkUser(); }
}

handleStateChange(state, data) {
logger.debug('authenticator state change ' + state);
if (!this._isMounted) return;
if (state === this.state.authState) { return; }

if (state === 'signedOut') { state = 'signIn'; }
Expand All @@ -103,13 +109,15 @@ export default class Authenticator extends React.Component {
const statesJumpToSignIn = ['signedIn', 'signedOut', 'loading'];
Auth.currentAuthenticatedUser()
.then(user => {
if (!this._isMounted) return;
if (user) {
this.handleStateChange('signedIn', null);
} else {
if (statesJumpToSignIn.includes(authState)) this.handleStateChange('signIn', null);
}
})
.catch(err => {
if (!this._isMounted) return;
logger.debug(err);
if (statesJumpToSignIn.includes(authState)) {
Auth.signOut()
Expand Down
8 changes: 8 additions & 0 deletions packages/aws-amplify-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="1.0.7-unstable.1"></a>
## [1.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/[email protected]@1.0.7-unstable.1) (2018-08-16)




**Note:** Version bump only for package aws-amplify-react

<a name="1.0.7-unstable.0"></a>
## [1.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/[email protected]@1.0.7-unstable.0) (2018-08-15)

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-amplify-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-amplify-react",
"version": "1.0.7-unstable.0",
"version": "1.0.7-unstable.1",
"description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -51,7 +51,7 @@
}
},
"dependencies": {
"aws-amplify": "^1.0.7-unstable.0",
"aws-amplify": "^1.0.7-unstable.1",
"qrcode.react": "^0.8.0",
"regenerator-runtime": "^0.11.1"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/aws-amplify/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="1.0.7-unstable.1"></a>
## [1.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/[email protected]@1.0.7-unstable.1) (2018-08-16)




**Note:** Version bump only for package aws-amplify

<a name="1.0.7-unstable.0"></a>
## [1.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/[email protected]@1.0.7-unstable.0) (2018-08-15)

Expand Down
6 changes: 3 additions & 3 deletions packages/aws-amplify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-amplify",
"version": "1.0.7-unstable.0",
"version": "1.0.7-unstable.1",
"description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
Expand Down Expand Up @@ -48,8 +48,8 @@
},
"dependencies": {
"@aws-amplify/analytics": "^1.0.5",
"@aws-amplify/api": "^1.0.7-unstable.0",
"@aws-amplify/auth": "^1.0.7-unstable.0",
"@aws-amplify/api": "^1.0.7-unstable.1",
"@aws-amplify/auth": "^1.0.7-unstable.1",
"@aws-amplify/cache": "^1.0.5",
"@aws-amplify/core": "^1.0.5",
"@aws-amplify/interactions": "^1.0.5",
Expand Down

0 comments on commit 9336538

Please sign in to comment.