-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
refactor: merge authSession
function into useSession
hook
#1391
refactor: merge authSession
function into useSession
hook
#1391
Conversation
β Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for oss-insights ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
authSession
function into useSession
hook
@babblebey maybe I miscommunicated the intent here. There should only be the |
Done @brandonroberts I had few ideas to approach this in mind but here's what I settled for... Return a local
|
β¦tps://github.com/babblebey/insights into refactor--merge-authSession-into-useSession-hook
β¦tps://github.com/babblebey/insights into refactor--merge-authSession-into-useSession-hook
@babblebey changes look good thanks. After the merge conflicts are resolved, its good to go |
β¦tps://github.com/babblebey/insights into refactor--merge-authSession-into-useSession-hook
Phew π |
### [1.57.1-beta.6](v1.57.1-beta.5...v1.57.1-beta.6) (2023-07-25) ### π§βπ» Code Refactoring * merge `authSession` function into `useSession` hook ([#1391](#1391)) ([d6c230d](d6c230d))
π This PR is included in version 1.57.1-beta.6 π The release is available on GitHub release Your semantic-release bot π¦π |
## [1.58.0](v1.57.0...v1.58.0) (2023-08-02) ### π§βπ» Code Refactoring * merge `authSession` function into `useSession` hook ([#1391](#1391)) ([d6c230d](d6c230d)) ### π¨ Styles * add width and max width for created at in contributor-profile-tab ([#1429](#1429)) ([5614886](5614886)) * remove irrelevant padding in page divider ([#1427](#1427)) ([5faaa4e](5faaa4e)) ### π Features * add devcard button to user profile ([#1339](#1339)) ([6a1dbdc](6a1dbdc)) * new contributor highlight card ([#1443](#1443)) ([c88000b](c88000b)) * update redirect to feed page for unauthenticated users ([#1464](#1464)) ([6d8505f](6d8505f)) ### π Bug Fixes * add checkbox id name if not available based on label ([#1466](#1466)) ([68f66a7](68f66a7)) * add navigation to improve accessibility ([#1436](#1436)) ([d1d85f7](d1d85f7)) * contributor profile tab click state flicker ([#1432](#1432)) ([c9cf8ed](c9cf8ed)) * Deleted page button changed to delete highlight ([#1419](#1419)) ([d502605](d502605)) * fixed bug on chatbot button overlay ([#1420](#1420)) ([2a94583](2a94583)) * hide onboarding button on mobile ([#1460](#1460)) ([f63f240](f63f240)) * Improve Keyboard Accessibility for Notification Icon ([#1435](#1435)) ([05291c0](05291c0)) * improve layout design for large screens [#1231](#1231) ([#1437](#1437)) ([d8ae808](d8ae808)) * misaligned chat button close icon ([#1422](#1422)) ([60f22bd](60f22bd)) * mismatched selection color ([#1430](#1430)) ([8a1d37b](8a1d37b)) * reduce tab font size in contributors profile page ([#1413](#1413)) ([238dc2f](238dc2f)) * show repo filters on initial `feeds` route visit ([#1426](#1426)) ([833ee30](833ee30)) * tab inconsistency in user profile matching the url ([#1403](#1403)) ([f8c6766](f8c6766))
π This PR is included in version 1.58.0 π The release is available on GitHub release Your semantic-release bot π¦π |
Description
This pull request refactors the
useSession
hook and incorporates (and deprecates) the functionality of the deprecatedauthSession
function, resulting in an improved and more organized approach to handle session-related data and authentication.Changes Made
authSession
function into theuseSession
hook to consolidate related functionalities and enhance code maintainability.authSession
function with the newloadSession
function, which performs the same session data retrieval from the backend API, and made the function available as a returned value under the sameauthSession
name making it accessible to users if needed.loadSession
andsetStoreData
.loadSession
function now handles the API call to fetch session data and returns the parsed data when the response is successful. In case of an error, it returnsfalse
.setStoreData
function is responsible for updating the store state with the obtained session data, keeping the code more modular and readable.authSession
function stating its migration to theuseSession
hook.authSession
with theuseSession
in the codebase.What type of PR is this? (check all applicable)
Related Tickets & Documents
Fixes #1169
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?