cmd/rpcfetch: update replace counter in ui thread

This commit is contained in:
Yonah 2025-04-19 21:29:48 +09:00
parent aa0b11a793
commit 8eb33b2fc0
Signed by: yonah
SSH Key Fingerprint: SHA256:vnQvK8+XXH9Tbni2AV1a/8qdVK/zPcXw52GM0ruQvwA

View File

@ -60,10 +60,8 @@ type applyState struct {
func (s *applyState) replace(t string) string { func (s *applyState) replace(t string) string {
for k, f := range substitute { for k, f := range substitute {
t = strings.ReplaceAll(t, "%"+k, f(s)) t = strings.ReplaceAll(t, "%"+k, f(s))
go func() { replCounter.Add(uint64(len(t)))
replCounter.Add(uint64(len(t))) statusReplaces.SetText(strconv.Itoa(int(replCounter.Load())) + " bytes")
statusReplaces.SetText(strconv.Itoa(int(replCounter.Load())) + " bytes")
}()
} }
return t return t
} }