From c0d45cbd2a9200f02814a9f578caa5dd48bcbafb Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:46:57 +0100 Subject: [PATCH] fix duplicated history --- ShhShell/Host/HostsManager.swift | 1 - ShhShell/Views/Hosts/RecentsView.swift | 2 -- 2 files changed, 3 deletions(-) diff --git a/ShhShell/Host/HostsManager.swift b/ShhShell/Host/HostsManager.swift index c9f3058..62ecd89 100644 --- a/ShhShell/Host/HostsManager.swift +++ b/ShhShell/Host/HostsManager.swift @@ -51,7 +51,6 @@ 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 4dc97c6..849d362 100644 --- a/ShhShell/Views/Hosts/RecentsView.swift +++ b/ShhShell/Views/Hosts/RecentsView.swift @@ -13,8 +13,6 @@ struct RecentsView: View { @State var historyCount: Int = 1 -// @State var displayedHistory: [History] = [] - var body: some View { if !hostsManager.history.isEmpty { Section("Recents") {