only check once for filters v2 availability (#4539)
Instead of calling the endpoint every time filters are needed, it will be called only once and the result cached. This will result in quite some requests less on instances supporting v2. I also tested v1 filters and made some small improvements. We should [remove filters v1 support](https://github.com/tuskyapp/Tusky/issues/4538) some time in the future though.
This commit is contained in:
parent
859ffd121e
commit
8a57bcc3f4
13 changed files with 1470 additions and 127 deletions
|
|
@ -28,13 +28,6 @@ data class FilterV1(
|
|||
val irreversible: Boolean,
|
||||
@Json(name = "whole_word") val wholeWord: Boolean
|
||||
) {
|
||||
companion object {
|
||||
const val HOME = "home"
|
||||
const val NOTIFICATIONS = "notifications"
|
||||
const val PUBLIC = "public"
|
||||
const val THREAD = "thread"
|
||||
const val ACCOUNT = "account"
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return id.hashCode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue