diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-22 14:32:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 14:32:15 -0400 |
commit | f0cff95cfa612b295caf68552bc3d29a7fb23a42 (patch) | |
tree | dd3df697478a19048cd4bf6d0b499a91c1a93eb3 /src/utils/hooks.ts | |
parent | 4e8e1c0d58424e6b63cfb8470fc0a73c0e6b102b (diff) | |
parent | 33c172cc31957966b14321520c56816ba044db14 (diff) |
Merge pull request #374 from IvanIFChen/hotfix-linting-fixup
[HOTFIX] Linter fixup
Diffstat (limited to 'src/utils/hooks.ts')
-rw-r--r-- | src/utils/hooks.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/hooks.ts b/src/utils/hooks.ts index 3914ef48..336ac26c 100644 --- a/src/utils/hooks.ts +++ b/src/utils/hooks.ts @@ -4,10 +4,10 @@ import {useEffect, useState} from 'react'; export const useAsyncStorage = (key: string, defaultValue: string) => { const [storedValue, setStoredValue] = useState<string>(defaultValue); - const getStoredItem = async (key: string, defaultValue: string) => { + const getStoredItem = async (currentKey: string, currentValue: string) => { try { - const item = await AsyncStorage.getItem(key); - const value = item ? item : defaultValue; + const item = await AsyncStorage.getItem(currentKey); + const value = item ? item : currentValue; setStoredValue(value); } catch (error) { console.log(error); |