Skip to content

Commit 3cc9de1

Browse files
authored
Merge pull request #20 from rtmelsov/feat/on
feat: для демо видео
2 parents cbb6742 + a645a16 commit 3cc9de1

File tree

7 files changed

+8
-18
lines changed

7 files changed

+8
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ db/migrations/*.sql-journal
2222
.DS_Store
2323
/var/
2424
opt/
25+
demo.mp4

internal/helpers/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
var (
1111
Addr = "89.207.255.214:8080"
12-
DownloadFilesDir = "./"
12+
DownloadFilesDir = "."
1313
)
1414

1515
type Config struct {

internal/tui/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type ProfileModel struct {
1818
}
1919

2020
type TuiModel struct {
21+
StreamLoading bool
22+
2123
uploadCh <-chan models.Prog
2224
Uploaded int64
2325
UploadTotal int64

internal/tui/file_screen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func (m TuiModel) FileDetailsAction(msg string) (tea.Model, tea.Cmd) {
6262
}
6363
if m.RightCursor == 1 {
6464
m.Loading = true
65+
m.StreamLoading = true
6566
return m, tea.Batch(
6667
m.Spin.Tick,
6768
func() tea.Msg {

internal/tui/screen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (m TuiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
9393
}
9494
case finishedMsg:
9595
m.Loading = false
96+
m.StreamLoading = false
9697
switch msg.Kind {
9798
case OpUpload:
9899
m.Uploading = false

internal/tui/vault_screen.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,6 @@ func listenNext(kind OpKind, id string, ch <-chan models.Prog) tea.Cmd {
6767
}
6868
}
6969

70-
func startUploadCmd(id, path string) tea.Cmd {
71-
return func() tea.Msg {
72-
ch := make(chan models.Prog, 32)
73-
go akclient.UploadFile(path, ch)
74-
return progressChanReadyMsg{Kind: OpUpload, ID: id, ch: ch}
75-
}
76-
}
77-
78-
func startDownloadCmd(id, fileID, outPath string) tea.Cmd {
79-
return func() tea.Msg {
80-
ch := make(chan models.Prog, 32)
81-
go akclient.DownloadFile(fileID, ch)
82-
return progressChanReadyMsg{Kind: OpDownload, ID: id, ch: ch}
83-
}
84-
}
85-
8670
func (m TuiModel) VaultAction(msg string) (tea.Model, tea.Cmd) {
8771
switch msg {
8872
case "esc":
@@ -108,6 +92,7 @@ func (m TuiModel) VaultAction(msg string) (tea.Model, tea.Cmd) {
10892
return m, m.FilePicker.Init() // ← важный момент
10993
} else if m.SelectedFile != "" {
11094
m.Loading = true
95+
m.StreamLoading = true
11196
return m, tea.Batch(
11297
m.Spin.Tick,
11398
func() tea.Msg {

internal/tui/view.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (m TuiModel) View() string {
2323
// --- Header/status (outside the box) ---
2424
status := ""
2525
if m.Loading {
26-
if m.Uploading || m.Downloading {
26+
if m.StreamLoading {
2727
return m.loadingView()
2828
} else {
2929
status = ui.StatusBar.Render(m.Spin.View()+" Загрузка…") +

0 commit comments

Comments
 (0)