diff --git a/ShhShell/Host/HostsManager.swift b/ShhShell/Host/HostsManager.swift index 62ecd89..c9f3058 100644 --- a/ShhShell/Host/HostsManager.swift +++ b/ShhShell/Host/HostsManager.swift @@ -51,6 +51,7 @@ class HostsManager: ObservableObject, @unchecked Sendable { } func addToHistory(_ host: Host) { + history = [History(host: host, count: 1)] + history history.append(History(host: host, count: 1)) formatHistory() saveHistory() diff --git a/ShhShell/Views/Hosts/RecentsView.swift b/ShhShell/Views/Hosts/RecentsView.swift index 583699e..4dc97c6 100644 --- a/ShhShell/Views/Hosts/RecentsView.swift +++ b/ShhShell/Views/Hosts/RecentsView.swift @@ -13,11 +13,12 @@ struct RecentsView: View { @State var historyCount: Int = 1 +// @State var displayedHistory: [History] = [] + var body: some View { if !hostsManager.history.isEmpty { Section("Recents") { - ForEach(0..