Skip to content

Commit

Permalink
Merge pull request #492 from rajnishdargan/release-1.1.0
Browse files Browse the repository at this point in the history
Issue #PS-3678 feat: Setting userSpecificBoard values to localStorage
  • Loading branch information
itsvick authored Jan 28, 2025
2 parents 909b4e5 + 8ef246c commit 5bc9dbc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@ const LoginPage = () => {
//set user info in zustand store
if (typeof window !== "undefined" && window.localStorage) {
if (userInfo) {
if (userInfo?.customFields) {
const boardValues = userInfo.customFields
.filter((field: any) => field.label === "BOARD")
.flatMap((field: any) => field.value.split(","))
.map((board: string) => board.trim());

// Check if boardValues is not empty
if (boardValues.length > 0) {
console.log(boardValues);
localStorage.setItem("userSpecificBoard", JSON.stringify(boardValues));
} else {
console.log("No BOARD field found in customFields. Skipping localStorage update.");
}
}
localStorage.setItem("adminInfo", JSON.stringify(userInfo));
}
localStorage.setItem("stateName", userInfo?.customFields[0]?.value);
Expand Down

0 comments on commit 5bc9dbc

Please sign in to comment.