Skip to content

Commit ff9de49

Browse files
committed
fix: integrate artifactTagMsg into update loop
1 parent ebeacaa commit ff9de49

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

internal/tui/update.go

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,27 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
274274
m.searchMsg = fmt.Sprintf("Downloaded: %s", msg.filename)
275275
return m, nil
276276

277-
case artifactTagMsg:
278-
m.loadingArtifacts = false
279-
if msg.err == nil {
280-
for i := range m.artifacts {
281-
if m.artifacts[i].ID == msg.artifactID {
282-
m.artifacts[i].Tag = msg.tag
283-
break
277+
case artifactChecksumMsg:
278+
m.loadingArtifacts = false
279+
if msg.err == nil && msg.checksum != "" {
280+
for i := range m.artifacts {
281+
if m.artifacts[i].ID == msg.artifactID {
282+
m.artifacts[i].Checksum = msg.checksum
283+
break
284+
}
284285
}
285286
}
286-
}
287-
return m, nil
287+
case artifactTagMsg:
288+
m.loadingArtifacts = false
289+
if msg.err == nil {
290+
for i := range m.artifacts {
291+
if m.artifacts[i].ID == msg.artifactID {
292+
m.artifacts[i].Tag = msg.tag
293+
break
294+
}
295+
}
296+
}
297+
return m, nil
288298

289299
case tickMsg:
290300
cmds := []tea.Cmd{tickCmdWithInterval(m.currentPollInterval())}

0 commit comments

Comments
 (0)