mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-03 03:17:21 +00:00
Added a function to clear the database #79
This commit is contained in:
1 parent
a7427f3632
commit
e9dc166e1e
8 files changed
+44
-6
No files matched your search
@@ -102,6 +102,14 @@ class DataRepository(
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearData() {
|
||||
repositoryScope.launch {
|
||||
_updateState.value = DataState.Loading
|
||||
localSource.clearData()
|
||||
_updateState.value = DataState.Success(0L)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getSatelliteItems(): Flow<List<SatItem>> = localSource.getSatelliteItems()
|
||||
|
||||
override suspend fun getSelectedSatellites() = localSource.getSelectedSatellites()
|
||||
|
||||
@@ -39,4 +39,6 @@ interface ILocalSource {
|
||||
suspend fun updateEntriesSelection(catnums: List<Int>, isSelected: Boolean)
|
||||
|
||||
suspend fun updateTransmitters(transmitters: List<Transmitter>)
|
||||
|
||||
suspend fun clearData()
|
||||
}
|
||||
@@ -34,6 +34,8 @@ interface IDataRepository {
|
||||
|
||||
fun updateDataFromWeb(sources: List<String>)
|
||||
|
||||
fun clearData()
|
||||
|
||||
fun getSatelliteItems(): Flow<List<SatItem>>
|
||||
|
||||
suspend fun getSelectedSatellites(): List<Satellite>
|
||||
|
||||
Reference in new issue
Block a user