fix: Prevent unnecessary theme change calls in ThemeScreen
This commit is contained in:
@@ -107,8 +107,10 @@ fun ThemeScreen(
|
||||
title = "Light",
|
||||
isSelected = themeMode == "light",
|
||||
onClick = {
|
||||
themeMode = "light"
|
||||
onThemeChange(false)
|
||||
if (themeMode != "light") {
|
||||
themeMode = "light"
|
||||
onThemeChange(false)
|
||||
}
|
||||
},
|
||||
textColor = textColor,
|
||||
secondaryTextColor = secondaryTextColor,
|
||||
@@ -121,8 +123,10 @@ fun ThemeScreen(
|
||||
title = "Dark",
|
||||
isSelected = themeMode == "dark",
|
||||
onClick = {
|
||||
themeMode = "dark"
|
||||
onThemeChange(true)
|
||||
if (themeMode != "dark") {
|
||||
themeMode = "dark"
|
||||
onThemeChange(true)
|
||||
}
|
||||
},
|
||||
textColor = textColor,
|
||||
secondaryTextColor = secondaryTextColor,
|
||||
|
||||
Reference in New Issue
Block a user