Fixed display issue if upload logs button is hidden

This commit is contained in:
Sylvain Berfini 2024-07-02 10:10:21 +02:00
parent 77e99fbfd3
commit c4fa68858c
3 changed files with 7 additions and 3 deletions

View file

@ -57,6 +57,10 @@ class CorePreferences @UiThread constructor(private val context: Context) {
config.setBool("app", "first_6.0_launch", value)
}
@get:WorkerThread
val checkForUpdateServerUrl: String
get() = config.getString("misc", "version_check_url_root", "").orEmpty()
@get:WorkerThread @set:WorkerThread
var conditionsAndPrivacyPolicyAccepted: Boolean
get() = config.getBool("app", "read_and_agree_terms_and_privacy", false)

View file

@ -26,6 +26,7 @@ import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
import org.linphone.BuildConfig
import org.linphone.LinphoneApplication.Companion.coreContext
import org.linphone.LinphoneApplication.Companion.corePreferences
import org.linphone.R
import org.linphone.core.Core
import org.linphone.core.CoreListenerStub
@ -136,8 +137,7 @@ class HelpViewModel @UiThread constructor() : GenericViewModel() {
coreContext.postOnCoreThread { core ->
core.addListener(coreListener)
val checkUpdateServerUrl = core.config.getString("misc", "version_check_url_root", "")
checkUpdateAvailable.postValue(!checkUpdateServerUrl.isNullOrEmpty())
checkUpdateAvailable.postValue(corePreferences.checkForUpdateServerUrl.isNotEmpty())
uploadLogsAvailable.postValue(!core.logCollectionUploadServerUrl.isNullOrEmpty())
}
}

View file

@ -113,7 +113,7 @@
android:layout_marginEnd="16dp"
android:layout_marginTop="24dp"
android:text="@string/help_troubleshooting_app_version_title"
app:layout_constraintTop_toBottomOf="@id/send_logs"
app:layout_constraintTop_toBottomOf="@id/clean_logs"
app:layout_constraintStart_toEndOf="@id/app_version_icon"
app:layout_constraintEnd_toEndOf="parent"/>