mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
don't show new version notification every time home window is opened in first session
This commit is contained in:
parent
b7344bfedd
commit
6e6247ff32
@ -218,8 +218,7 @@ class DownloadActions(
|
||||
val copyDownloadLinkAction = simpleAction(
|
||||
title = Res.string.copy_link.asStringSource(),
|
||||
icon = MyIcons.copy,
|
||||
checkEnable =
|
||||
selections.mapStateFlow { it.isNotEmpty() },
|
||||
checkEnable = selections.mapStateFlow { it.isNotEmpty() },
|
||||
onActionPerformed = {
|
||||
scope.launch {
|
||||
ClipboardUtil.copy(
|
||||
@ -427,6 +426,14 @@ class HomeComponent(
|
||||
private val defaultCategories: DefaultCategories by inject()
|
||||
val fileIconProvider: FileIconProvider by inject()
|
||||
|
||||
init {
|
||||
HomeComponent.homeComponentCreationCount++
|
||||
}
|
||||
|
||||
private fun isFirstVisitInThisSession(): Boolean {
|
||||
return HomeComponent.homeComponentCreationCount == 1
|
||||
}
|
||||
|
||||
init {
|
||||
homePageStateToPersist
|
||||
.debounce(500)
|
||||
@ -820,6 +827,7 @@ class HomeComponent(
|
||||
downloads.any { it.id == previouslySelectedItem }
|
||||
}
|
||||
}.launchIn(scope)
|
||||
if (isFirstVisitInThisSession()) {
|
||||
// if the app is updated then clean downloaded files
|
||||
if (appVersionTracker.isUpgraded()) {
|
||||
// clean update files
|
||||
@ -848,6 +856,7 @@ class HomeComponent(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val selectionListItems = combineStateFlows(
|
||||
selectionList,
|
||||
@ -986,6 +995,7 @@ class HomeComponent(
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var homeComponentCreationCount = 0
|
||||
val CATEGORIES_SIZE_RANGE = 0.dp..500.dp
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user