Skip to content

Commit 71d707e

Browse files
committed
fix(details): manage download job lifecycle and fix Korean locale resources
This commit fixes a potential race condition in the download process by ensuring previous download jobs are cancelled before starting a new one. It also corrects the ISO language code for Korean resource files. - **fix(details)**: Added job cancellation and cleanup logic to `InstallWithExternalApp` action in `DetailsViewModel`. - **fix(details)**: Reset `currentAssetName` after successful installation prompt. - **fix(i18n)**: Renamed Korean resource directory and file from `values-kr/strings-kr.xml` to `values-ko/strings-ko.xml` to follow standard ISO 639-1 language codes.
1 parent 5a00191 commit 71d707e

File tree

2 files changed

+6
-1
lines changed
  • core/presentation/src/commonMain/composeResources/values-ko
  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation

2 files changed

+6
-1
lines changed

core/presentation/src/commonMain/composeResources/values-kr/strings-kr.xml renamed to core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml

File renamed without changes.

feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsViewModel.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,8 @@ class DetailsViewModel(
778778
}
779779

780780
DetailsAction.InstallWithExternalApp -> {
781-
viewModelScope.launch {
781+
currentDownloadJob?.cancel()
782+
currentDownloadJob = viewModelScope.launch {
782783
try {
783784
val primary = _state.value.primaryAsset
784785
val release = _state.value.selectedRelease
@@ -849,8 +850,11 @@ class DetailsViewModel(
849850
)
850851
}
851852
}
853+
} finally {
854+
currentDownloadJob = null
852855
}
853856
}
857+
854858
_state.update {
855859
it.copy(isInstallDropdownExpanded = false)
856860
}
@@ -956,6 +960,7 @@ class DetailsViewModel(
956960
showExternalInstallerPrompt = true,
957961
pendingInstallFilePath = filePath
958962
)
963+
currentAssetName = null
959964
appendLog(
960965
assetName = assetName,
961966
size = sizeBytes,

0 commit comments

Comments
 (0)