- Changed `initDeviceType` to use async/await for better readability and error handling. - Updated the app initialization process to await `initDeviceType` for proper sequencing. - Refactored `migrateDatabase` to use async/await, improving error handling and code clarity. - Adjusted the structure of `RootProviders` to ensure proper nesting of components. This refactor enhances the overall code quality and maintainability. Signed-off-by: Innei <tukon479@gmail.com>
10 lines
262 B
TypeScript
10 lines
262 B
TypeScript
import { getDeviceTypeAsync } from "expo-device"
|
|
|
|
import { appAtoms } from "../atoms/app"
|
|
import { jotaiStore } from "../lib/jotai"
|
|
|
|
export async function initDeviceType() {
|
|
const type = await getDeviceTypeAsync()
|
|
jotaiStore.set(appAtoms.deviceType, type)
|
|
}
|