1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 17:44:05 +08:00
This commit is contained in:
shaoying 2022-12-26 09:09:19 +08:00
parent 24bc1861ab
commit 5f3c3e4b36

View File

@ -76,6 +76,9 @@ func Toast30s(m *ice.Message, text string, arg ...ice.Any) {
}
func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int))) {
cb(func(name string, count, total int) {
if total == 0 {
total = 1
}
Toast(m,
kit.Format("%s %s/%s", name, strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
kit.Format("%s %d%%", title, count*100/total),