Skip to content

Commit

Permalink
useLocalstorage_problem_solve
Browse files Browse the repository at this point in the history
  • Loading branch information
milon27 committed Aug 15, 2021
1 parent 2c2cbd5 commit 3032150
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"**/*"
],
"ios": {
"supportsTablet": true
"supportsTablet": true,
"bundleIdentifier": "com.milon27.passwordmanager"
},
"android": {
"adaptiveIcon": {
Expand All @@ -26,4 +27,4 @@
},
"description": ""
}
}
}
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"start": "expo start",
"android": "expo start --android",
"build": "expo build:android",
"build_ios": "expo build:ios",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
Expand Down Expand Up @@ -36,4 +37,4 @@
"@babel/core": "^7.9.0"
},
"private": true
}
}
4 changes: 2 additions & 2 deletions src/utils/helpers/hooks/useAsyncstorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export default function useAsyncStorage(key, initValue) {

useEffect(() => {
const load = async () => {
await AsyncStorage.setItem(prefixed_key, JSON.stringify(initValue))
await AsyncStorage.setItem(prefixed_key, JSON.stringify(user))
}
load()
}, [prefixed_key, state])
}, [prefixed_key, user])

return [user, setUser]
}
4 changes: 2 additions & 2 deletions src/utils/helpers/hooks/useLocalstorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default function useLocalstorage(key, initValue) {
})

useEffect(() => {
localStorage.setItem(prefixed_key, JSON.stringify(initValue))
}, [prefixed_key, state])
localStorage.setItem(prefixed_key, JSON.stringify(user))
}, [prefixed_key, user])

return [user, setUser]
}

0 comments on commit 3032150

Please sign in to comment.