android: fix MainActivity crash by applying theme after Hilt injection
This commit is contained in:
@@ -33,6 +33,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
private var pendingNotificationMessageId by mutableStateOf<Long?>(null)
|
private var pendingNotificationMessageId by mutableStateOf<Long?>(null)
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
val savedThemeMode = runBlocking { themeRepository.getThemeMode() }
|
val savedThemeMode = runBlocking { themeRepository.getThemeMode() }
|
||||||
AppCompatDelegate.setDefaultNightMode(
|
AppCompatDelegate.setDefaultNightMode(
|
||||||
when (savedThemeMode) {
|
when (savedThemeMode) {
|
||||||
@@ -41,7 +42,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
AppThemeMode.SYSTEM -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
AppThemeMode.SYSTEM -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
pendingInviteToken = intent.extractInviteToken()
|
pendingInviteToken = intent.extractInviteToken()
|
||||||
pendingVerifyEmailToken = intent.extractVerifyEmailToken()
|
pendingVerifyEmailToken = intent.extractVerifyEmailToken()
|
||||||
pendingResetPasswordToken = intent.extractResetPasswordToken()
|
pendingResetPasswordToken = intent.extractResetPasswordToken()
|
||||||
|
|||||||
Reference in New Issue
Block a user