-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Frontend] Local storage handling #252
base: main
Are you sure you want to change the base?
Conversation
Emang sengaja dibuat masih |
Iya nan, jaga-jaga kalau ada case yg miss Update: ready to review on 17:25 WIB |
useEffect(() => { | ||
if (localStorage.getItem(ENROLL_SNAPSHOT)) { | ||
localStorage.removeItem(ENROLL_SNAPSHOT) | ||
} | ||
}, []) |
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.
gw enroll face berhasil terus gw refresh, coba lagi, masih kesimpen foto sebelumnya tapi gabisa next. local storage disini bukannya emg tujuanya biar user ga perlu foto lagi kalo ke refresh/keluar halaman?
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.
Noted, jim. Kadang kalo solution nya tengah jalan ditinggalin user, string base64 nya tetep disimpen di localStorage. Takut user nya kaget aja pas buka lagi abis udah lama ga buka.
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.
Berarti di useEffectnya mesti ada condition buat ngecheck kalau session_idnya masih ada atau engga, kalau engga adaa berarti baru kita apus di local storagenya, kayak gitu?
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.
Boleh kalo pengen nambah cek session_id jim
Type of changes
Please check the type of change your PR introduces:
What is the current behaviour?
There's a few instances where the picture stays on the cam uploader.
What is the new behavior?
Add a new function using useEffect which removes item from the localStorage everytime the component is mounted.
Checklist
[Unreleased]
ChangelogSecurity Pentester API Checklist
Does this introduce a breaking change?
Other information
Please test the edge cases with different user flows