CleanNodeDatabaseViewModel

class CleanNodeDatabaseViewModel @Inject constructor(nodeRepository: NodeRepository, radioConfigRepository: RadioConfigRepository) : ViewModel

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
@Inject
constructor(nodeRepository: NodeRepository, radioConfigRepository: RadioConfigRepository)

Properties

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

Functions

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

Updates the list of nodes to be deleted based on the current filter criteria. The logic is as follows:

Link copied to clipboard
Link copied to clipboard