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

Skip download notes when loading notes url

parent 8f08ae59
...@@ -67,12 +67,14 @@ class InstallViewModel( ...@@ -67,12 +67,14 @@ 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() -> ""
val text = svc.fetchString(Const.Url.CHANGELOG_URL) else -> {
writeText(text) val text = svc.fetchString(Const.Url.CHANGELOG_URL)
text writeText(text)
text
}
} }
} }
} catch (e: IOException) { } catch (e: IOException) {
......
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