Skip to content

Commit 255cec8

Browse files
committed
Fix: Improve I/O
Signed-off-by: imknown <imknown@qq.com>
1 parent d6576e5 commit 255cec8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/net/imknown/android/forefrontinfo/ui/home/HomeViewModel.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ class HomeViewModel(
9696
LldManager.copyJsonIfNeededOrThrow()
9797
}
9898
} catch (e: Exception) {
99+
val lld = withContext(Dispatchers.IO) {
100+
LldManager.getAssetLld(MyApplication.instance.assets)
101+
}
102+
99103
val errorMessage = errorMessage(R.string.lld_json_save_failed, e)
100104

101-
val lld = LldManager.getAssetLld(MyApplication.instance.assets)
102105
return lld to errorMessage
103106
}
104107

0 commit comments

Comments
 (0)