-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linting and Prettier formatting (#139)
* Linting and Prettier formatting * fix tsc errors * fix minor runtime error * fix useEffect errors * prettier * disable no-console rule
- Loading branch information
Showing
36 changed files
with
1,439 additions
and
1,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
declare namespace NodeJS { | ||
interface ProcessEnv { | ||
EXPO_PUBLIC_API_BASE: string; | ||
EXPO_PUBLIC_CLIENT_ID: string; | ||
EXPO_PUBLIC_STRIPE_API_KEY: string; | ||
} | ||
} | ||
interface ProcessEnv { | ||
EXPO_PUBLIC_API_BASE: string; | ||
EXPO_PUBLIC_CLIENT_ID: string; | ||
EXPO_PUBLIC_STRIPE_API_KEY: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import AsyncStorage from '@react-native-async-storage/async-storage'; | ||
import { AppState } from 'react-native'; | ||
import AsyncStorage from "@react-native-async-storage/async-storage"; | ||
import { AppState } from "react-native"; | ||
|
||
export default function asyncStorageProvider() { | ||
const map = new Map(); | ||
// Initialize the map with data from AsyncStorage | ||
(async () => { | ||
try { | ||
const appCache = await AsyncStorage.getItem('app-cache'); | ||
const appCache = await AsyncStorage.getItem("app-cache"); | ||
if (appCache) { | ||
JSON.parse(appCache).forEach(([key, value]) => { | ||
JSON.parse(appCache).forEach(([key, value]: [string, unknown]) => { | ||
map.set(key, value); | ||
}); | ||
} | ||
} catch (error) { | ||
console.error('Error initializing asyncStorageProvider:', error); | ||
console.error("Error initializing asyncStorageProvider:", error); | ||
} | ||
})(); | ||
// Save the map to AsyncStorage before the app goes to the background | ||
const saveAppCache = async () => { | ||
try { | ||
const appCache = JSON.stringify(Array.from(map.entries())); | ||
await AsyncStorage.setItem('app-cache', appCache); | ||
await AsyncStorage.setItem("app-cache", appCache); | ||
} catch (error) { | ||
console.error('Error saving asyncStorageProvider cache:', error); | ||
console.error("Error saving asyncStorageProvider cache:", error); | ||
} | ||
}; | ||
AppState.addEventListener('change', (nextAppState) => { | ||
if (nextAppState === 'background' || nextAppState === 'inactive') { | ||
AppState.addEventListener("change", (nextAppState) => { | ||
if (nextAppState === "background" || nextAppState === "inactive") { | ||
saveAppCache(); | ||
} | ||
}); | ||
return map; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.