mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Fix #545
This commit is contained in:
parent
4d4b9c0d6d
commit
2a531f1a1e
2 changed files with 9 additions and 1 deletions
|
@ -61,6 +61,13 @@ class DownloadStore(context: Context) {
|
|||
preferences.edit().remove(getKey(download)).apply()
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all the downloads from the store.
|
||||
*/
|
||||
fun clear() {
|
||||
preferences.edit().clear().apply()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the preference's key for the given download.
|
||||
*
|
||||
|
@ -93,7 +100,7 @@ class DownloadStore(context: Context) {
|
|||
}
|
||||
|
||||
// Clear the store, downloads will be added again immediately.
|
||||
preferences.edit().clear().apply()
|
||||
clear()
|
||||
return downloads
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ class DownloadQueue(
|
|||
download.setStatusSubject(null)
|
||||
}
|
||||
queue.clear()
|
||||
store.clear()
|
||||
updatedRelay.call(Unit)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue