From 101cbcacb671a1621af6ee2a49ac2021f9abe1c6 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Wed, 20 Dec 2023 15:55:50 -0800 Subject: Stop requesting news when closing category. Add Server should do nothing right now (was hooked up to refresh). --- Hotline/macOS/NewsView.swift | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Hotline/macOS/NewsView.swift') diff --git a/Hotline/macOS/NewsView.swift b/Hotline/macOS/NewsView.swift index 3c35b1b..15e9db4 100644 --- a/Hotline/macOS/NewsView.swift +++ b/Hotline/macOS/NewsView.swift @@ -3,8 +3,6 @@ import UniformTypeIdentifiers struct NewsItemView: View { @Environment(Hotline.self) private var model: Hotline - - @State var expanded = false var news: NewsInfo let depth: Int @@ -79,15 +77,13 @@ struct NewsItemView: View { .frame(maxWidth: .infinity, maxHeight: .infinity) .padding(.leading, CGFloat(depth * (12 + 10))) .onChange(of: news.expanded) { -// if news.isFolder { - print("EXPANDED \(news.name)? \(expanded)") if news.type == .bundle || news.type == .category { - Task { - await model.getNewsList(at: news.path) -// await model.getFileList(path: file.path) + if news.expanded { + Task { + await model.getNewsList(at: news.path) + } } } -// } } if news.expanded { -- cgit