From 06a131ce4bcd6f40161635869585a69fd1055b58 Mon Sep 17 00:00:00 2001 From: Devesh326 Date: Fri, 26 Jan 2024 12:11:09 +0530 Subject: [PATCH] added localstorage functionality for the root user --- schema.graphql | 1 + src/components/UserUpdate/UserUpdate.tsx | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/schema.graphql b/schema.graphql index 9e349f8908..08186aabfb 100644 --- a/schema.graphql +++ b/schema.graphql @@ -903,6 +903,7 @@ input UpdateUserInput { email: EmailAddress firstName: String lastName: String + id: String } input UpdateUserPasswordInput { diff --git a/src/components/UserUpdate/UserUpdate.tsx b/src/components/UserUpdate/UserUpdate.tsx index e1af925308..eb448e57a2 100644 --- a/src/components/UserUpdate/UserUpdate.tsx +++ b/src/components/UserUpdate/UserUpdate.tsx @@ -107,10 +107,13 @@ const UserUpdate: React.FC = ({ applangcode: '', file: '', }); - // localStorage.setItem('FirstName', firstName); - // localStorage.setItem('LastName', lastName); - // localStorage.setItem('Email', email); - // localStorage.setItem('UserImage', file); + + if (localStorage.getItem('id') === currentUrl) { + localStorage.setItem('FirstName', firstName); + localStorage.setItem('LastName', lastName); + localStorage.setItem('Email', email); + localStorage.setItem('UserImage', file); + } toast.success('Successful updated'); toggleStateValue();