mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
upadete updatetheme
This commit is contained in:
@@ -129,15 +129,14 @@ class HostsManager: ObservableObject, @unchecked Sendable {
|
||||
}
|
||||
|
||||
func updateTheme(_ theme: Theme) {
|
||||
guard let index = themes.firstIndex(where: { $0.id == theme.id }) else {
|
||||
themes.append(theme)
|
||||
saveThemes()
|
||||
return
|
||||
}
|
||||
if let index = themes.firstIndex(where: { $0.id == theme.id }) {
|
||||
themes[index] = theme
|
||||
if selectedTheme.id == theme.id {
|
||||
selectedTheme = theme
|
||||
}
|
||||
} else {
|
||||
themes.append(theme)
|
||||
}
|
||||
saveThemes()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user