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)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val savedThemeMode = runBlocking { themeRepository.getThemeMode() }
|
||||
AppCompatDelegate.setDefaultNightMode(
|
||||
when (savedThemeMode) {
|
||||
@@ -41,7 +42,6 @@ class MainActivity : AppCompatActivity() {
|
||||
AppThemeMode.SYSTEM -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
}
|
||||
)
|
||||
super.onCreate(savedInstanceState)
|
||||
pendingInviteToken = intent.extractInviteToken()
|
||||
pendingVerifyEmailToken = intent.extractVerifyEmailToken()
|
||||
pendingResetPasswordToken = intent.extractResetPasswordToken()
|
||||
|
||||
Reference in New Issue
Block a user