Skip to content

Commit 81d4bbe

Browse files
committed
feat(details): prevent deletion of downloaded assets on desktop after installation
- Clear `cachedDownloadAssetName` on non-Android platforms when a file is installed or handed off to the system. - Prevents the `onCleared()` lifecycle method from deleting the downloaded asset once it has been saved to the user's downloads or installed.
1 parent 10f49f8 commit 81d4bbe

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ class DetailsViewModel(
10731073
installOutcome = installOutcome,
10741074
)
10751075
} else if (platform != Platform.ANDROID) {
1076+
cachedDownloadAssetName = null
10761077
viewModelScope.launch {
10771078
_events.send(DetailsEvent.OnMessage(getString(Res.string.installer_saved_downloads)))
10781079
}

0 commit comments

Comments
 (0)