show rules of the correct instance on the auth screen (#4358)

closes #4357
This commit is contained in:
Konrad Pozniak 2024-04-05 12:01:54 +02:00 committed by GitHub
parent b524d57d64
commit 0d3b1b1c5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -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 }
}, },

View File

@ -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>>