|
@@ -557,25 +557,30 @@ extension KMLeftSideViewController {
|
|
}
|
|
}
|
|
|
|
|
|
@objc func removeAllReplyAnnotations(_ sender: NSMenuItem?) {
|
|
@objc func removeAllReplyAnnotations(_ sender: NSMenuItem?) {
|
|
- self.dataUpdating = true
|
|
|
|
- for model in self.annoListModel?.datas ?? [] {
|
|
|
|
- for item in model.items {
|
|
|
|
-// if let anno = item.anno {
|
|
|
|
-// self.listView?.remove(anno)
|
|
|
|
-// }
|
|
|
|
- guard let annoM = item as? KMBotaAnnotationModel else {
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- for replyM in annoM.replyAnnos {
|
|
|
|
-// self.listView?.remove(replyM.replyAnno)
|
|
|
|
- replyM.replyAnno?.page.removeAnnotation(replyM.replyAnno)
|
|
|
|
|
|
+ Task {
|
|
|
|
+ let response = await KMAlertTool.runModel(message: KMLocalizedString("Are you sure to delete all comment replies?", nil), buttons: [KMLocalizedString("Yes", nil), KMLocalizedString("No", nil)])
|
|
|
|
+ if response == .alertFirstButtonReturn {
|
|
|
|
+ self.dataUpdating = true
|
|
|
|
+ for model in self.annoListModel?.datas ?? [] {
|
|
|
|
+ for item in model.items {
|
|
|
|
+ // if let anno = item.anno {
|
|
|
|
+ // self.listView?.remove(anno)
|
|
|
|
+ // }
|
|
|
|
+ guard let annoM = item as? KMBotaAnnotationModel else {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ for replyM in annoM.replyAnnos {
|
|
|
|
+ // self.listView?.remove(replyM.replyAnno)
|
|
|
|
+ replyM.replyAnno?.page.removeAnnotation(replyM.replyAnno)
|
|
|
|
+ }
|
|
|
|
+ annoM.replyAnnos.removeAll()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- annoM.replyAnnos.removeAll()
|
|
|
|
|
|
+ self.dataUpdating = false
|
|
|
|
+
|
|
|
|
+ self.note_refrshUIIfNeed()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- self.dataUpdating = false
|
|
|
|
-
|
|
|
|
- self.note_refrshUIIfNeed()
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@objc func editNoteTextFromTable(_ sender: NSMenuItem) {
|
|
@objc func editNoteTextFromTable(_ sender: NSMenuItem) {
|