aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
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);