android: fix MainActivity crash by applying theme after Hilt injection
Some checks failed
Android CI / android (push) Has started running
Android Release / release (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
Codex
2026-03-09 23:56:02 +03:00
parent cdf7859668
commit 15f9836224

View File

@@ -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()