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(
try {
val context = get<Context>()
File(context.cacheDir, "${BuildConfig.VERSION_CODE}.md").run {
notes = if (exists())
readText()
else {
notes = when {
exists() -> readText()
Const.Url.CHANGELOG_URL.isEmpty() -> ""
else -> {
val text = svc.fetchString(Const.Url.CHANGELOG_URL)
writeText(text)
text
}
}
}
} catch (e: IOException) {
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