Skip to content

Commit 51ee0ff

Browse files
committed
Keep the view in parse on errors
1 parent b6b5278 commit 51ee0ff

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

internal/server/html/html.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,24 @@ func Parsed(w http.ResponseWriter, data PageData) error {
9494
if err != nil {
9595
slog.Warn("failed to parse logs", "error", err)
9696
data.Error = err
97-
}
97+
data.Views.Parse = "checked"
98+
} else {
99+
slog.Info("txs", "count", len(ts.Transactions()))
98100

99-
slog.Info("txs", "count", len(ts.Transactions()))
101+
data.Transactions.Set = ts
102+
data.Transactions.Count = len(ts.Transactions())
100103

101-
data.Transactions.Set = ts
102-
data.Transactions.Count = len(ts.Transactions())
104+
if data.Transactions.Count > 0 {
105+
data.Views.Overview = "checked"
106+
} else {
107+
data.Views.Parse = "checked"
108+
}
103109

104-
if data.Transactions.Count > 0 {
105-
data.Views.Overview = "checked"
106-
} else {
107-
data.Views.Parse = "checked"
110+
data.Transactions.GroupCount = len(ts.GroupRelatedTransactions())
111+
data.Logs.Raw = ts.RawLog()
112+
data.Title = fmt.Sprintf("%d txs parsed", data.Transactions.Count)
108113
}
109114

110-
data.Transactions.GroupCount = len(ts.GroupRelatedTransactions())
111-
data.Logs.Raw = ts.RawLog()
112-
data.Title = fmt.Sprintf("%d txs parsed", data.Transactions.Count)
113-
114115
return executeTemplate(w, parsed, "main_layout.html", data)
115116
}
116117

0 commit comments

Comments
 (0)