Check run updater preference in action

This commit is contained in:
Syer10
2022-06-29 22:57:59 -04:00
parent cf44c1ee20
commit c7e98581a6
5 changed files with 12 additions and 26 deletions

View File

@@ -21,8 +21,8 @@ class UpdateChecker @Inject constructor(
private val updatePreferences: UpdatePreferences,
private val client: Http
) {
fun checkForUpdates() = flow {
// if (!updatePreferences.enabled().get()) return
fun checkForUpdates(manualFetch: Boolean) = flow {
if (!manualFetch && !updatePreferences.enabled().get()) return@flow
val latestRelease = client.get(
"https://api.github.com/repos/$GITHUB_REPO/releases/latest"
).body<GithubRelease>()