show rules of the correct instance on the auth screen (#4358)
closes #4357
This commit is contained in:
parent
b524d57d64
commit
0d3b1b1c5a
|
@ -39,7 +39,7 @@ class LoginWebViewViewModel @Inject constructor(
|
||||||
if (this.domain == null) {
|
if (this.domain == null) {
|
||||||
this.domain = domain
|
this.domain = domain
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
api.getInstance().fold(
|
api.getInstance(domain).fold(
|
||||||
{ instance ->
|
{ instance ->
|
||||||
_instanceRules.value = instance.rules.map { rule -> rule.text }
|
_instanceRules.value = instance.rules.map { rule -> rule.text }
|
||||||
},
|
},
|
||||||
|
|
|
@ -89,7 +89,9 @@ interface MastodonApi {
|
||||||
): NetworkResult<InstanceV1>
|
): NetworkResult<InstanceV1>
|
||||||
|
|
||||||
@GET("api/v2/instance")
|
@GET("api/v2/instance")
|
||||||
suspend fun getInstance(): NetworkResult<Instance>
|
suspend fun getInstance(
|
||||||
|
@Header(DOMAIN_HEADER) domain: String? = null
|
||||||
|
): NetworkResult<Instance>
|
||||||
|
|
||||||
@GET("api/v1/filters")
|
@GET("api/v1/filters")
|
||||||
suspend fun getFiltersV1(): NetworkResult<List<FilterV1>>
|
suspend fun getFiltersV1(): NetworkResult<List<FilterV1>>
|
||||||
|
|
Loading…
Reference in New Issue