No more duplication of recors at database

This commit is contained in:
Luis Fernando Molina committed 2018-09-09 21:07:54 +02:00
1 parent 6f3c02cae0
commit 64101169d4
2 files changed
+55 -14

No files matched your search

+10 -1
View File
@@ -55,7 +55,16 @@ class NavBar extends Component {
if (userStored !== null && userStored !== undefined && userStored !== 'undefined') {
const user = JSON.parse(userStored);
const authId = user.authId;
/* For some reason, the result of GraphQL some times varies, that is why I had to do the following hack. */
let authId;
if (user.authId === undefined) {
authId = user.sub;
} else {
authId = user.authId;
}
console.log("user", user);
console.log("authid", authId);
this.setState({ authId: authId });