Commit 4cc41ecc authored by vvb2060's avatar vvb2060 Committed by topjohnwu

Skip download notes when loading notes url

parent 8f08ae59
...@@ -67,14 +67,16 @@ class InstallViewModel( ...@@ -67,14 +67,16 @@ class InstallViewModel(
try { try {
val context = get<Context>() val context = get<Context>()
File(context.cacheDir, "${BuildConfig.VERSION_CODE}.md").run { File(context.cacheDir, "${BuildConfig.VERSION_CODE}.md").run {
notes = if (exists()) notes = when {
readText() exists() -> readText()
else { Const.Url.CHANGELOG_URL.isEmpty() -> ""
else -> {
val text = svc.fetchString(Const.Url.CHANGELOG_URL) val text = svc.fetchString(Const.Url.CHANGELOG_URL)
writeText(text) writeText(text)
text text
} }
} }
}
} catch (e: IOException) { } catch (e: IOException) {
Timber.e(e) Timber.e(e)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment