Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix showing ReleaseNotes ui bug #7693

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
compileSdk compile_sdk_version
minSdkVersion min_sdk_version
targetSdkVersion compile_sdk_version
versionCode 117
versionCode 118
versionName "0.40.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ private fun MainScreen(
R.id.releaseNotesFragment,
ReleaseNotesFragment.Input(true)
)
viewModel.whatsNewShown()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ class MainViewModel(

fun whatsNewShown() {
showWhatsNew = false
releaseNotesManager.updateShownAppVersion()
emitState()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import androidx.navigation.NavController
import io.horizontalsystems.bankwallet.R
import io.horizontalsystems.bankwallet.core.BaseComposeFragment
import io.horizontalsystems.bankwallet.core.getInput
import io.horizontalsystems.bankwallet.modules.main.MainModule
import io.horizontalsystems.bankwallet.modules.main.MainViewModel
import io.horizontalsystems.bankwallet.modules.markdown.MarkdownContent
import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme
import io.horizontalsystems.bankwallet.ui.compose.TranslatableString
Expand Down Expand Up @@ -56,10 +54,9 @@ fun ReleaseNotesScreen(
closeablePopup: Boolean,
onCloseClick: () -> Unit,
viewModel: ReleaseNotesViewModel = viewModel(factory = ReleaseNotesModule.Factory()),
mainViewModel: MainViewModel = viewModel(factory = MainModule.Factory())
) {
BackHandler() {
mainViewModel.whatsNewShown()
viewModel.whatsNewShown()
onCloseClick.invoke()
}

Expand All @@ -73,7 +70,7 @@ fun ReleaseNotesScreen(
title = TranslatableString.ResString(R.string.Button_Close),
icon = R.drawable.ic_close,
onClick = {
mainViewModel.whatsNewShown()
viewModel.whatsNewShown()
onCloseClick.invoke()
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ object ReleaseNotesModule {
App.networkManager,
App.releaseNotesManager.releaseNotesUrl,
App.connectivityManager,
App.releaseNotesManager,
App.appConfigProvider
) as T
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import io.horizontalsystems.bankwallet.core.INetworkManager
import io.horizontalsystems.bankwallet.core.managers.ConnectivityManager
import io.horizontalsystems.bankwallet.core.managers.ReleaseNotesManager
import io.horizontalsystems.bankwallet.core.providers.AppConfigProvider
import io.horizontalsystems.bankwallet.entities.ViewState
import io.horizontalsystems.bankwallet.modules.markdown.MarkdownBlock
Expand All @@ -21,6 +22,7 @@ class ReleaseNotesViewModel(
private val networkManager: INetworkManager,
private val contentUrl: String,
private val connectivityManager: ConnectivityManager,
private val releaseNotesManager: ReleaseNotesManager,
appConfigProvider: AppConfigProvider
) : ViewModel() {

Expand Down Expand Up @@ -50,6 +52,10 @@ class ReleaseNotesViewModel(
loadContent()
}

fun whatsNewShown() {
releaseNotesManager.updateShownAppVersion()
}

private fun loadContent() {
viewModelScope.launch {
try {
Expand Down
Loading