-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue Fix: Issue 165 - isAdmin state is moved to zustand store and associated functionality is changed #210
Conversation
…sociated functions are changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly make these changes and attach a screen recording of the admin functinality working as intended. Collect admin creds from Alfiya
Removed all the unwanted comments from the code base and also attaching a video showcasing the admin functionality. PB-isAdmin-Functionality.1.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the above comments, rest LGTM
app/(default)/hustle/page.tsx
Outdated
setIsAdmin(isAdmin); | ||
setIsAdminLoggedIn(true); | ||
setAdmin(isAdmin); | ||
setAdmin(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant code, setting it to isAdmin and then again to true
} catch (error) { | ||
console.error("Error checking admin status:", error); | ||
setIsAdmin(false); | ||
setIsAdminLoggedIn(false); | ||
setAdmin(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant code, setting it to isAdmin and then again to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
} | ||
}; | ||
|
||
const unsubscribe = onAuthStateChanged(auth, (user) => { | ||
if (user) { | ||
checkAdmin(user.uid); | ||
} else { | ||
setIsAdmin(false); | ||
setIsAdminLoggedIn(false); | ||
setAdmin(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -1,5 +1,9 @@ | |||
"use client"; | |||
|
|||
|
|||
import { useStore } from "@/lib/zustand/store"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
components/ui/header.tsx
Outdated
|
||
reset(); | ||
} | ||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the ==== here? maybe the merge wasnt done properly
Crazy work! LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
Summary: What does this PR do?
Which issue(s) this PR fixes
Changes Made
Describe the changes you've made in this PR:
Type of Change
How Has This Been Tested?
Describe the tests you ran:
Please describe the test cases and expected behavior:
Screenshots (if applicable)
Dependencies
Documentation
Comments:
Reviewer Notes