mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
Delete history when deleting an application
This commit is contained in:
@@ -169,6 +169,9 @@ interface ApplicationDao {
|
||||
@Query("SELECT * FROM history2 ORDER BY time DESC")
|
||||
fun getAllHistory(): Flow<List<HistoryEntity2>>
|
||||
|
||||
@Query("DELETE FROM history2 where pkKey = :pk")
|
||||
suspend fun deleteHistory(pk: String)
|
||||
|
||||
@Insert
|
||||
@Transaction
|
||||
suspend fun insertLog(logEntity: LogEntity)
|
||||
|
||||
@@ -467,6 +467,7 @@ object BunkerRequestUtils {
|
||||
|
||||
if (oldKey.isNotBlank()) {
|
||||
database.applicationDao().delete(oldKey)
|
||||
database.applicationDao().deleteHistory(oldKey)
|
||||
}
|
||||
|
||||
var savedApplication = database.applicationDao().getByKey(key)
|
||||
|
||||
@@ -320,6 +320,7 @@ fun EditConfigurationScreen(
|
||||
application?.let {
|
||||
scope.launch(Dispatchers.IO) {
|
||||
Amber.instance.getDatabase(account.npub).applicationDao().delete(it.application)
|
||||
Amber.instance.getDatabase(account.npub).applicationDao().deleteHistory(it.application.key)
|
||||
|
||||
Amber.instance.checkForNewRelays()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user