Change how the Inspector renames web feeds and folders so that they will sync

This commit is contained in:
Maurice Parker 2020-07-19 17:07:09 -05:00
parent a521673ac6
commit 88745755b6
1 changed files with 2 additions and 6 deletions

View File

@ -140,9 +140,7 @@ struct InspectorView: View {
}.onReceive(inspectorModel.$shouldUpdate) { value in
if value == true {
if inspectorModel.editedName.trimmingWhitespace.count > 0 {
(sidebarItem.feed as? WebFeed)?.editedName = inspectorModel.editedName
} else {
(sidebarItem.feed as? WebFeed)?.editedName = nil
(sidebarItem.feed as? WebFeed)?.rename(to: inspectorModel.editedName.trimmingWhitespace) { _ in }
}
presentationMode.wrappedValue.dismiss()
}
@ -190,9 +188,7 @@ struct InspectorView: View {
.onReceive(inspectorModel.$shouldUpdate) { value in
if value == true {
if inspectorModel.editedName.trimmingWhitespace.count > 0 {
(sidebarItem.feed as? Folder)?.name = inspectorModel.editedName
} else {
(sidebarItem.feed as? Folder)?.name = nil
(sidebarItem.feed as? Folder)?.rename(to: inspectorModel.editedName.trimmingWhitespace) { _ in }
}
presentationMode.wrappedValue.dismiss()
}