Skip to content

Commit

Permalink
[no-jira] Hotfix for 3.27.2 intent is null (#2189)
Browse files Browse the repository at this point in the history
* check if intent is null before passing it to discovery view model

* override onNewIntent

* add connectivity check to activity

* revert

* linter

---------

Co-authored-by: Leigh Douglas <[email protected]>
  • Loading branch information
leighdouglas and Leigh Douglas authored Dec 11, 2024
1 parent 355ecb3 commit 95476a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.kickstarter.ui.IntentKey
import com.kickstarter.ui.adapters.DiscoveryDrawerAdapter
import com.kickstarter.ui.adapters.DiscoveryPagerAdapter
import com.kickstarter.ui.data.LoginReason
import com.kickstarter.ui.extensions.setUpConnectivityStatusCheck
import com.kickstarter.ui.extensions.showErrorSnackBar
import com.kickstarter.ui.extensions.showSuccessSnackBar
import com.kickstarter.ui.extensions.startActivityWithTransition
Expand Down Expand Up @@ -57,6 +58,8 @@ class DiscoveryActivity : AppCompatActivity() {
installSplashScreen()

super.onCreate(savedInstanceState)
setUpConnectivityStatusCheck(lifecycle)

binding = DiscoveryLayoutBinding.inflate(layoutInflater)
WindowInsetsUtil.manageEdgeToEdge(
window,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ interface DiscoveryViewModel {
}

fun provideIntent(intent: Intent) {
this.intent.onNext(intent)
if (intent.isNotNull()) {
this.intent.onNext(intent)
}
}

override fun onCleared() {
Expand Down

0 comments on commit 95476a9

Please sign in to comment.