fix(menubar): 修正进程退出判断与公网刷新及风扇语言
This commit is contained in:
@@ -14,10 +14,9 @@ struct ProcessTableView: View {
|
||||
@State private var searchFocused = false
|
||||
|
||||
private var held: Bool { hovering || selected != nil || !search.isEmpty }
|
||||
private var selectedRow: ProcessMetrics? { rows.first { $0.id == selected } }
|
||||
private var selectedRow: ProcessMetrics? { snapshot?.rows.first { $0.id == selected } }
|
||||
private var exitedSelection: ProcessIdentity? {
|
||||
guard let selected, snapshot != nil, !rows.contains(where: { $0.id == selected }) else { return nil }
|
||||
return selected
|
||||
ProcessTableProjection.exitedSelection(selected, in: snapshot)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -74,7 +73,7 @@ struct ProcessTableView: View {
|
||||
.task(id: exitedSelection) {
|
||||
guard let id = exitedSelection else { return }
|
||||
do { try await Task.sleep(for: .seconds(3)) } catch { return }
|
||||
if selected == id { selected = nil; departed = nil }
|
||||
if exitedSelection == id { selected = nil; departed = nil }
|
||||
}
|
||||
.onExitCommand {
|
||||
if !search.isEmpty { search = "" }
|
||||
|
||||
Reference in New Issue
Block a user