Files
Folo/apps/mobile/src/initialize/device.ts
T
Innei c7afad6b27 fix(mobile): update device initialization and migration handling
- 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>
2025-04-22 12:47:33 +08:00

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)
}