diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-01-01 11:35:49 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-01-01 11:35:49 -0800 |
| commit | 5d2aadbc834393b532d043d6298d6a23b80c2a5c (patch) | |
| tree | dcf139b67179d5bc3ad3ed69e949a1e7c1d18177 /Hotline/macOS/FilesView.swift | |
| parent | a4cbaea0b12b7dd42133b4bd14f1371f1000fcc0 (diff) | |
File downloads now working in macOS client.1.0beta4
Diffstat (limited to 'Hotline/macOS/FilesView.swift')
| -rw-r--r-- | Hotline/macOS/FilesView.swift | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Hotline/macOS/FilesView.swift b/Hotline/macOS/FilesView.swift index 771836d..09354ed 100644 --- a/Hotline/macOS/FilesView.swift +++ b/Hotline/macOS/FilesView.swift @@ -138,6 +138,10 @@ struct FilesView: View { if clickedFile.isFolder { clickedFile.expanded.toggle() } + else { + print("DOWNLOAD FILE", clickedFile.name, clickedFile.path) + model.downloadFile(clickedFile.name, path: clickedFile.path) + } } .onKeyPress(.rightArrow) { if let s = selection, s.isFolder { @@ -175,6 +179,12 @@ struct FilesView: View { ToolbarItem(placement: .primaryAction) { Button { + if let s = selection, !s.isFolder { + print("DOWNLOAD FILE", s.name, s.path) + model.previewFile(s.name, path: s.path, addTransfer: true) { transfer, fileData in + print("FILE PREVIEWED?", fileData.count) + } + } } label: { Label("Preview File", systemImage: "eye") } @@ -191,6 +201,10 @@ struct FilesView: View { ToolbarItem(placement: .primaryAction) { Button { + if let s = selection, !s.isFolder { + print("DOWNLOAD FILE", s.name, s.path) + model.downloadFile(s.name, path: s.path) + } } label: { Label("Download File", systemImage: "square.and.arrow.down") } |