Fix warning in Example project when failing to load credentials
This commit is contained in:
parent
fcd76decbf
commit
eeeb703278
|
@ -32,8 +32,11 @@ export default class KeychainExample extends Component {
|
||||||
Keychain
|
Keychain
|
||||||
.getGenericPassword()
|
.getGenericPassword()
|
||||||
.then((credentials) => {
|
.then((credentials) => {
|
||||||
this.setState(credentials);
|
if (credentials) {
|
||||||
this.setState({status: 'Credentials loaded!'});
|
this.setState({ ...credentials, status: 'Credentials loaded!' });
|
||||||
|
} else {
|
||||||
|
this.setState({ status: 'No credentials stored.' });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.setState({ status: 'Could not load credentials. ' + err });
|
this.setState({ status: 'Could not load credentials. ' + err });
|
||||||
|
|
Loading…
Reference in New Issue