chore: standardize resources and update documentation for Navigation 3 (#4961)

This commit is contained in:
James Rich 2026-03-31 16:25:37 -05:00 committed by GitHub
parent 1faa802fe6
commit 464a12b9f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 216 additions and 149 deletions

View file

@ -58,6 +58,7 @@ actual fun getInMemoryDatabaseBuilder(): RoomDatabase.Builder<MeshtasticDatabase
actual fun getDatabaseDirectory(): Path = documentDirectory().toPath()
/** Deletes the database and its Room-associated files on iOS. */
@OptIn(ExperimentalForeignApi::class)
actual fun deleteDatabase(dbName: String) {
val dir = documentDirectory()
NSFileManager.defaultManager.removeItemAtPath(dir + "/$dbName.db", null)
@ -83,6 +84,7 @@ private object PreferencesSerializer : OkioSerializer<Preferences> {
}
/** Creates an iOS DataStore for database preferences. */
@OptIn(ExperimentalForeignApi::class)
actual fun createDatabaseDataStore(name: String): DataStore<Preferences> {
val dir = documentDirectory() + "/datastore"
NSFileManager.defaultManager.createDirectoryAtPath(dir, true, null, null)