Вынос IStorageInfo и IVaultInfo

This commit is contained in:
Roman Pytkov
2025-01-04 03:07:28 +03:00
parent db30408278
commit 8302e9442e
14 changed files with 34 additions and 35 deletions

View File

@@ -9,6 +9,7 @@ import java.util.UUID
class LocalStorage(
override val uuid: UUID,
override val isEncrypted: Boolean,
absolutePath: String,
ioDispatcher: CoroutineDispatcher
) : IStorage {

View File

@@ -53,7 +53,7 @@ class LocalVault(private val ioDispatcher: CoroutineDispatcher, context: Context
if (dirs != null) {
_storages.value = dirs.map {
val uuid = UUID.fromString(it.name)
LocalStorage(uuid, it.path, ioDispatcher)
LocalStorage(uuid, false, it.path, ioDispatcher)
}
}
}
@@ -66,7 +66,7 @@ class LocalVault(private val ioDispatcher: CoroutineDispatcher, context: Context
val uuid = UUID.randomUUID()
val next = Path(path.path, uuid.toString())
next.createDirectory()
val newStorage = LocalStorage(uuid, next.pathString, ioDispatcher)
val newStorage = LocalStorage(uuid, false, next.pathString, ioDispatcher)
_storages.value = _storages.value.toMutableList().apply {
add(newStorage)
}