fix user-defined theme being added to list on first startup

This commit is contained in:
Helium314 2025-03-02 11:39:33 +01:00
parent 18693cdf20
commit e342ff24b5

View file

@ -201,9 +201,11 @@ fun checkVersionUpgrade(context: Context) {
if (colorsDay.any { it.color != null }) {
KeyboardTheme.writeUserColors(prefs, themeNameDay, colorsDay)
}
val moreColorsDay = prefs.getInt("theme_color_show_more_colors", 0)
prefs.edit().remove("theme_color_show_more_colors").apply()
KeyboardTheme.writeUserMoreColors(prefs, themeNameDay, moreColorsDay)
if (prefs.contains("theme_color_show_more_colors")) {
val moreColorsDay = prefs.getInt("theme_color_show_more_colors", 0)
prefs.edit().remove("theme_color_show_more_colors").apply()
KeyboardTheme.writeUserMoreColors(prefs, themeNameDay, moreColorsDay)
}
if (prefs.contains("theme_color_all_colors")) {
val allColorsDay = readAllColorsMap(false)
prefs.edit().remove("theme_color_all_colors").apply()
@ -224,9 +226,11 @@ fun checkVersionUpgrade(context: Context) {
if (colorsNight.any { it.color!= null }) {
KeyboardTheme.writeUserColors(prefs, themeNameNight, colorsNight)
}
val moreColorsNight = prefs.getInt("theme_dark_color_show_more_colors", 0)
prefs.edit().remove("theme_dark_color_show_more_colors").apply()
KeyboardTheme.writeUserMoreColors(prefs, themeNameNight, moreColorsNight)
if (prefs.contains("theme_dark_color_show_more_colors")) {
val moreColorsNight = prefs.getInt("theme_dark_color_show_more_colors", 0)
prefs.edit().remove("theme_dark_color_show_more_colors").apply()
KeyboardTheme.writeUserMoreColors(prefs, themeNameNight, moreColorsNight)
}
if (prefs.contains("theme_dark_color_all_colors")) {
val allColorsNight = readAllColorsMap(false)
prefs.edit().remove("theme_dark_color_all_colors").apply()