upadete updatetheme

This commit is contained in:
neon443 committed 2025-07-09 13:55:49 +01:00
1 parent e3e4108723
commit 3cc4a8c34b
1 file changed
+6 -7
+6 -7
View File
@@ -129,14 +129,13 @@ class HostsManager: ObservableObject, @unchecked Sendable {
} }
func updateTheme(_ theme: Theme) { func updateTheme(_ theme: Theme) {
guard let index = themes.firstIndex(where: { $0.id == theme.id }) else { if let index = themes.firstIndex(where: { $0.id == theme.id }) {
themes[index] = theme
if selectedTheme.id == theme.id {
selectedTheme = theme
}
} else {
themes.append(theme) themes.append(theme)
saveThemes()
return
}
themes[index] = theme
if selectedTheme.id == theme.id {
selectedTheme = theme
} }
saveThemes() saveThemes()
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.