mirror of
https://github.com/CherretGit/zaprett-app.git
synced 2026-03-22 00:28:15 +05:00
Compare commits
2 Commits
c387cd13b8
...
09cdb53791
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09cdb53791 | ||
|
|
f9b223d4e2 |
@@ -82,10 +82,12 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
if (prefs.getBoolean("auto_update", BuildConfig.auto_update)) {
|
||||
getUpdate(prefs)
|
||||
.onSuccess { updateData ->
|
||||
downloadUrl.value = updateData.updateInfo.downloadUrl
|
||||
changeLog.value = updateData.changelog
|
||||
newVersion.value = updateData.updateInfo.version
|
||||
updateAvailable.value = true
|
||||
if (updateData.updateInfo.versionCode > BuildConfig.VERSION_CODE) {
|
||||
downloadUrl.value = updateData.updateInfo.downloadUrl
|
||||
changeLog.value = updateData.changelog
|
||||
newVersion.value = updateData.updateInfo.version
|
||||
updateAvailable.value = true
|
||||
}
|
||||
}
|
||||
.onFailure { exception ->
|
||||
_errorFlow.value = exception.toString()
|
||||
|
||||
@@ -111,19 +111,19 @@ fun restartService(callback: (String) -> Unit) {
|
||||
|
||||
fun getModuleVersion(callback: (String) -> Unit) {
|
||||
Shell.cmd("zaprett --version").submit { result ->
|
||||
callback(result.out.first())
|
||||
if (result.isSuccess) callback(result.out.first())
|
||||
}
|
||||
}
|
||||
|
||||
fun getNfqwsVersion(callback: (String) -> Unit) {
|
||||
Shell.cmd("zaprett nfqws-version").submit { result ->
|
||||
callback(result.out.first())
|
||||
if (result.isSuccess) callback(result.out.first())
|
||||
}
|
||||
}
|
||||
|
||||
fun getNfqws2Version(callback: (String) -> Unit) {
|
||||
Shell.cmd("zaprett nfqws2-version").submit { result ->
|
||||
callback(result.out.first())
|
||||
if (result.isSuccess) callback(result.out.first())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user