fix: Prevent unnecessary theme change calls in ThemeScreen
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user