Skip to content

Commit

Permalink
Fixed bug when renaming a theme where the theme disappeared briefly a…
Browse files Browse the repository at this point in the history
…nd then reappeared shortly after with the new name.
  • Loading branch information
austincondiff committed Oct 26, 2024
1 parent 77efa39 commit 986514f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,6 @@ extension ThemeModel {
try filemanager.moveItem(at: oldURL, to: finalURL)

try self.loadThemes()

if let index = themes.firstIndex(where: { $0.fileURL == finalURL }) {
themes[index].displayName = finalName
themes[index].fileURL = finalURL
themes[index].name = finalName.lowercased().replacingOccurrences(of: " ", with: "-")
if isActive {
self.activateTheme(themes[index])
}
}

} catch {
print("Error renaming theme: \(error.localizedDescription)")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct ThemeSettingsThemeDetails: View {
VStack(spacing: 0) {
Form {
Group {
Text("Theme is\(isActive ? "" : " not") active")
Section {
TextField("Name", text: $theme.displayName)
TextField("Author", text: $theme.author)
Expand Down

0 comments on commit 986514f

Please sign in to comment.