mirror of
https://github.com/FranP-code/Hangman-game-with-React.git
synced 2025-10-13 00:42:32 +00:00
Build 2 started
This commit is contained in:
13
src/Storage Scripts/RecoveryCurrentCategory.js
Normal file
13
src/Storage Scripts/RecoveryCurrentCategory.js
Normal file
@@ -0,0 +1,13 @@
|
||||
export const RecoveryCurrentCategory = (setCategory) => {
|
||||
|
||||
if (localStorage.getItem('category')) {
|
||||
|
||||
if (localStorage.getItem('category') === 'false') {
|
||||
|
||||
setCategory(false)
|
||||
}
|
||||
|
||||
setCategory(localStorage.getItem('category'))
|
||||
localStorage.removeItem('category')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user