CleanNodeDatabaseViewModel

class CleanNodeDatabaseViewModel(cleanNodeDatabaseUseCase: CleanNodeDatabaseUseCase, alertManager: AlertManager) : ViewModel(source)

ViewModel for CleanNodeDatabaseScreen. Manages the state and logic for cleaning the node database based on specified criteria. The "older than X days" filter is always active.

Constructors

Link copied to clipboard
constructor(cleanNodeDatabaseUseCase: CleanNodeDatabaseUseCase, alertManager: AlertManager)

Properties

Link copied to clipboard
val nodesToDelete: StateFlow<List<Node>>
Link copied to clipboard
val olderThanDays: StateFlow<Float>
Link copied to clipboard
val onlyUnknownNodes: StateFlow<Boolean>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard

Deletes the nodes currently queued in _nodesToDelete from the database and instructs the mesh service to remove them.

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard

Updates the list of nodes to be deleted based on the current filter criteria.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard