[Frontend] Local storage handling#252
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.
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.
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.
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.
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