Jobslines schema. Added phone number formatting.

This commit is contained in:
Patrick Fic
2019-12-16 17:41:07 -08:00
parent 337048f0e9
commit 03d99a27c3
42 changed files with 1076 additions and 72 deletions

View File

@@ -49,14 +49,14 @@ class AppContainer extends Component {
// split based on operation type
({ query }) => {
const definition = getMainDefinition(query);
console.log(
"##Intercepted GQL Transaction : " +
definition.operation +
"|" +
definition.name.value +
"##",
query
);
// console.log(
// "##Intercepted GQL Transaction : " +
// definition.operation +
// "|" +
// definition.name.value +
// "##",
// query
// );
return (
definition.kind === "OperationDefinition" &&
definition.operation === "subscription"

View File

@@ -23,23 +23,24 @@ export default () => {
useEffect(() => {
//Run the auth code only on the first render.
const unsubscribeFromAuth = auth.onIdTokenChanged(async user => {
const unsubscribeFromAuth = auth.onAuthStateChanged(async user => {
if (user) {
let token;
token = await user.getIdToken();
const idTokenResult = await user.getIdTokenResult();
const hasuraClaim =
idTokenResult.claims["https://hasura.io/jwt/claims"];
if (!hasuraClaim) {
// Check if refresh is required.
const metadataRef = firebase
.database()
.ref("metadata/" + user.uid + "/refreshTime");
// Check if refresh is required.
const metadataRef = firebase
.database()
.ref("metadata/" + user.uid + "/refreshTime");
metadataRef.on("value", async params => {
console.log("params", params);
// Force refresh to pick up the latest custom claims changes.
token = await user.getIdToken(true);
});
metadataRef.on("value", async () => {
// Force refresh to pick up the latest custom claims changes.
token = await user.getIdToken(true);
});
}
apolloClient.writeData({
data: {