diff --git a/base/web/render.go b/base/web/render.go index 47a95a9f..05686ac1 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -123,9 +123,6 @@ func RenderResult(m *ice.Message, arg ...ice.Any) { func RenderTemplate(m *ice.Message, file string, arg ...ice.Any) *ice.Message { return m.RenderResult(kit.Renders(kit.Format(m.Cmdx(nfs.CAT, path.Join(ice.SRC_TEMPLATE, WEB, file)), arg...), m)) } -func RenderRefresh(m *ice.Message, arg ...string) { // url text delay - RenderTemplate(m, "refresh.html", kit.Select("3", arg, 2), kit.Select(m.Option(ice.MSG_USERWEB), arg, 0), kit.Select("loading...", arg, 1)) -} func RenderMain(m *ice.Message) *ice.Message { if m.IsCliUA() { return m.RenderDownload(path.Join(ice.USR_INTSHELL, ice.INDEX_SH)) diff --git a/core/chat/macos/applications.go b/core/chat/macos/applications.go index 9c4cc629..63c1d387 100644 --- a/core/chat/macos/applications.go +++ b/core/chat/macos/applications.go @@ -25,11 +25,9 @@ func init() { m.Travel(func(p *ice.Context, c *ice.Context, key string, cmd *ice.Command) { kit.If(cmd.Icon, func() { if !kit.HasPrefix(cmd.Icon, nfs.PS, web.HTTP) { - kit.If(!nfs.Exists(m, cmd.Icon), func() { nfs.Exists(m, ice.USR_ICONS+cmd.Icon, func(p string) { cmd.Icon = p }) }) - kit.If(!nfs.Exists(m, cmd.Icon), func() { - nfs.Exists(m, ctx.GetCmdFile(m, m.PrefixKey()), func(p string) { - cmd.Icon = path.Join(path.Dir(strings.TrimPrefix(p, kit.Path(""))), cmd.Icon) - }) + nfs.Exists(m, ice.USR_ICONS+cmd.Icon, func(p string) { cmd.Icon = p }) + nfs.Exists(m, path.Join(path.Dir(strings.TrimPrefix(ctx.GetCmdFile(m, m.PrefixKey()), kit.Path(""))), cmd.Icon), func(p string) { + cmd.Icon = p }) } AppInstall(m, cmd.Icon, m.PrefixKey()) @@ -42,14 +40,11 @@ func init() { }) } func install(m *ice.Message, cmd, icon, index string, arg ...string) { - name := kit.TrimExt(path.Base(icon), nfs.PNG, nfs.JPG, nfs.JPEG) - if icon != "" { - nfs.Exists(m, ice.USR_ICONS+icon, func(p string) { icon = p }) - if m.Warn(!strings.HasPrefix(icon, web.HTTP) && !nfs.Exists(m, icon)) { - m.Info("what %s", m.FormatStack(1, 100)) - return - } + if icon == "" { + return } + nfs.Exists(m, ice.USR_ICONS+icon, func(p string) { icon = p }) + name := kit.TrimExt(path.Base(icon), nfs.PNG, nfs.JPG, nfs.JPEG) m.Cmd(Prefix(cmd), mdb.CREATE, mdb.NAME, name, mdb.ICON, icon, ctx.INDEX, index, arg) } func AppInstall(m *ice.Message, icon, index string, arg ...string) {