Skip to content

Commit 1b38bb6

Browse files
committed
Don't show loading when update new script source
1 parent c31cb42 commit 1b38bb6

File tree

1 file changed

+3
-1
lines changed
  • app/src/main/java/com/paulcoding/hviewer/network

1 file changed

+3
-1
lines changed

app/src/main/java/com/paulcoding/hviewer/network/Github.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ object Github {
3838
suspend fun checkVersionOrUpdate() {
3939
withContext(Dispatchers.IO) {
4040
try {
41-
_stateFlow.update { it.copy(isLoading = true) }
4241
if (_stateFlow.value.remoteUrl != Preferences.getRemote()) {
4342
Preferences.setRemote(_stateFlow.value.remoteUrl)
43+
_stateFlow.update { it.copy(isLoading = true) }
4444
downloadAndGetConfig()
4545
return@withContext
4646
}
4747
if (!appContext.configFile.exists()) {
4848
log("Config file not exist, downloading from remote...", "check update")
49+
_stateFlow.update { it.copy(isLoading = true) }
4950
downloadAndGetConfig()
5051
return@withContext
5152
}
@@ -55,6 +56,7 @@ object Github {
5556

5657
if (currentConfigs == null) {
5758
log("Can not read config file, downloading from remote...", "check update")
59+
_stateFlow.update { it.copy(isLoading = true) }
5860
downloadAndGetConfig()
5961
} else {
6062
val siteConfigs = getSiteConfigs()

0 commit comments

Comments
 (0)