From 3d26737cccd57fcbb5289874363f030ecef77573 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Wed, 20 Dec 2023 19:01:59 -0800 Subject: Reverse sort order on news so most recent posts show at top in a category. --- Hotline/macOS/NewsView.swift | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'Hotline/macOS/NewsView.swift') diff --git a/Hotline/macOS/NewsView.swift b/Hotline/macOS/NewsView.swift index 15e9db4..33cc03e 100644 --- a/Hotline/macOS/NewsView.swift +++ b/Hotline/macOS/NewsView.swift @@ -87,25 +87,11 @@ struct NewsItemView: View { } if news.expanded { - ForEach(news.children, id: \.self) { childNews in + ForEach(news.children.reversed(), id: \.self) { childNews in NewsItemView(news: childNews, depth: self.depth + 1).tag(childNews.id) } } } - -// static let byteFormatter = ByteCountFormatter() -// -// private func formattedFileSize(_ fileSize: UInt) -> String { -// // let bcf = ByteCountFormatter() -// FileView.byteFormatter.allowedUnits = [.useAll] -// FileView.byteFormatter.countStyle = .file -// return FileView.byteFormatter.string(fromByteCount: Int64(fileSize)) -// } -// -// private func fileIcon(name: String) -> Image { -// let fileExtension = (name as NSString).pathExtension -// return Image(nsImage: NSWorkspace.shared.icon(for: UTType(filenameExtension: fileExtension) ?? UTType.content)) -// } } struct NewsView: View { -- cgit