Skip to content

Commit

Permalink
Fix showing ReleaseNotes ui bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelekol committed Oct 3, 2024
1 parent 2e93d15 commit 12cc03f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
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

0 comments on commit 12cc03f

Please sign in to comment.