From de304f3f698049ec3f2df548ca40e80fd080a618 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Mon, 4 Nov 2024 23:37:20 +0700 Subject: [PATCH] feat: mava script and user attribute --- web/src/context/AtlasProvider.tsx | 10 +++++++++- web/src/index.html | 13 +++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/web/src/context/AtlasProvider.tsx b/web/src/context/AtlasProvider.tsx index cdc6f1ac4..96fe72329 100644 --- a/web/src/context/AtlasProvider.tsx +++ b/web/src/context/AtlasProvider.tsx @@ -133,7 +133,15 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) = queryFn: async () => { try { if (!isVerified || isUndefined(address)) return undefined; - return await fetchUser(atlasGqlClient); + const user = await fetchUser(atlasGqlClient); + + if (user?.email && window.Mava) { + window.Mava.initialize(); + window.Mava.identify({ emailAddress: user.email }); + window.Mava.identify({ customAttributes: [{ label: "Wallet Address", value: address }] }); + } + + return user; } catch { return undefined; } diff --git a/web/src/index.html b/web/src/index.html index 559ef32f0..9d9685d0d 100644 --- a/web/src/index.html +++ b/web/src/index.html @@ -7,12 +7,17 @@ name="description" content="Kleros is a decentralized, blockchain-based dispute resolution platform that offers fast and affordable arbitration for various type of dispute. Join the future of dispute resolution with Kleros Court." /> - + Kleros ยท Court +