From 19e4f6df2203ac5446dd25501a5c234416d45d92 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Tue, 25 Oct 2022 21:33:03 +0800 Subject: [PATCH] opt some --- base/web/option.go | 2 +- misc/git/status.go | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/base/web/option.go b/base/web/option.go index e89e0152..e80f93fc 100644 --- a/base/web/option.go +++ b/base/web/option.go @@ -72,7 +72,7 @@ func Toast(m *ice.Message, text string, arg ...ice.Any) { // [title [duration [p } } - PushNoticeToast(m, "", text, arg) + PushNoticeToast(m, text, arg) } func Toast3s(m *ice.Message, text string, arg ...ice.Any) { Toast(m, text, kit.List(kit.Select("", arg, 0), kit.Select("3s", arg, 1))...) diff --git a/misc/git/status.go b/misc/git/status.go index db71c633..69c946db 100644 --- a/misc/git/status.go +++ b/misc/git/status.go @@ -14,7 +14,6 @@ import ( "shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/core/code" kit "shylinux.com/x/toolkits" - "shylinux.com/x/toolkits/task" ) func _status_tag(m *ice.Message, tags string) string { @@ -127,8 +126,7 @@ func _status_stat(m *ice.Message, files, adds, dels int) (int, int, int) { } func _status_list(m *ice.Message) (files, adds, dels int, last time.Time) { defer m.Sort("repos,type") - // m.Cmd(REPOS, ice.OptionFields("name,path")).Tables(func(value ice.Maps) { - m.Cmd(REPOS, ice.OptionFields("name,path")).TableGo(func(value ice.Maps, lock *task.Lock) { + m.Cmd(REPOS, ice.OptionFields("name,path")).Tables(func(value ice.Maps) { msg := m.Spawn(kit.Dict(cli.CMD_DIR, value[nfs.PATH])) diff := _git_cmds(msg, STATUS, "-sb") tags := _git_cmds(msg, "describe", "--tags") @@ -138,8 +136,7 @@ func _status_list(m *ice.Message) (files, adds, dels int, last time.Time) { if files, adds, dels = files+_files, adds+_adds, dels+_dels; now.After(last) { last = now } - defer lock.Lock()() - + for _, v := range strings.Split(strings.TrimSpace(diff), ice.NL) { if v == "" { continue