cmd/rpcfetch: update act in ui thread

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

View File

@ -84,6 +84,7 @@ func apply() {
act := *prof.Activity act := *prof.Activity
s := &applyState{} s := &applyState{}
fyne.DoAndWait(func() {
act.State = s.replace(act.State) act.State = s.replace(act.State)
act.Details = s.replace(act.Details) act.Details = s.replace(act.Details)
act.Timestamps = &discord.ActivityTimestamps{Start: launchTime.Unix()} act.Timestamps = &discord.ActivityTimestamps{Start: launchTime.Unix()}
@ -93,6 +94,7 @@ func apply() {
SmallImage: act.Assets.SmallImage, SmallImage: act.Assets.SmallImage,
SmallText: s.replace(act.Assets.SmallText), SmallText: s.replace(act.Assets.SmallText),
} }
})
confLock.RUnlock() confLock.RUnlock()
if nonce, err := retry(&act, s); err != nil { if nonce, err := retry(&act, s); err != nil {