aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-20 18:01:40 -0400
committerIvan Chen <ivan@tagg.id>2021-04-20 18:01:40 -0400
commitbb1479dfcd8daad8ef2593d4ac65a0b1239a6139 (patch)
treeca3d73f914ccacb232f54011b7d6299984e17140 /src/utils
parentc4e76811cae6cf14d5cc8daed9317f808087ed77 (diff)
linted
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/common.ts4
-rw-r--r--src/utils/hooks.ts6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/common.ts b/src/utils/common.ts
index 7ae36dc6..cec0e1b5 100644
--- a/src/utils/common.ts
+++ b/src/utils/common.ts
@@ -73,8 +73,8 @@ export const moveCategory: (
};
export const checkImageUploadStatus = (statusMap: object) => {
- for (let [key, value] of Object.entries(statusMap)) {
- if (value != 'Success') {
+ for (const value of Object.values(statusMap)) {
+ if (value !== 'Success') {
return false;
}
}
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);