fix: Prevent unnecessary theme change calls in ThemeScreen

This commit is contained in:
k1ngsterr1
2026-01-22 15:03:51 +05:00
parent c7443a7ed7
commit 957cdc4c19

View File

@@ -107,8 +107,10 @@ fun ThemeScreen(
title = "Light", title = "Light",
isSelected = themeMode == "light", isSelected = themeMode == "light",
onClick = { onClick = {
themeMode = "light" if (themeMode != "light") {
onThemeChange(false) themeMode = "light"
onThemeChange(false)
}
}, },
textColor = textColor, textColor = textColor,
secondaryTextColor = secondaryTextColor, secondaryTextColor = secondaryTextColor,
@@ -121,8 +123,10 @@ fun ThemeScreen(
title = "Dark", title = "Dark",
isSelected = themeMode == "dark", isSelected = themeMode == "dark",
onClick = { onClick = {
themeMode = "dark" if (themeMode != "dark") {
onThemeChange(true) themeMode = "dark"
onThemeChange(true)
}
}, },
textColor = textColor, textColor = textColor,
secondaryTextColor = secondaryTextColor, secondaryTextColor = secondaryTextColor,