Skip to content

Commit

Permalink
refactor: 状態との依存関係がわかりやすいようにリファクタ
Browse files Browse the repository at this point in the history
  • Loading branch information
pantasystem committed Jan 2, 2024
1 parent bca3493 commit 12f8a90
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/main/java/jp/panta/misskeyandroidclient/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ class MainActivity : AppCompatActivity(), ToolbarSetter {
context = this
).setup()

if (savedInstanceState == null) {
handleIntent()
}
handleIntent(savedInstanceState)


val mainEventDispatcher = mainEventDispatcherFactory.create()
Expand Down Expand Up @@ -219,11 +217,13 @@ class MainActivity : AppCompatActivity(), ToolbarSetter {
}
}

private fun handleIntent() {
mainActivityInitialIntentHandlerFactory.create(
binding.appBarMain.bottomNavigation,
this,
).invoke(intent)
private fun handleIntent(savedInstanceState: Bundle?) {
if (savedInstanceState == null) {
mainActivityInitialIntentHandlerFactory.create(
binding.appBarMain.bottomNavigation,
this,
).invoke(intent)
}
}

private fun setupOnBackPressedDispatcherCallBack() {
Expand Down

0 comments on commit 12f8a90

Please sign in to comment.