Fix #545
This commit is contained in:
parent
4d4b9c0d6d
commit
2a531f1a1e
@ -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 New Issue
Block a user