This commit is contained in:
2026-02-19 11:50:25 -06:00
parent 94fab7acee
commit 385b6ea67c
3 changed files with 276 additions and 94 deletions

View File

@@ -118,6 +118,7 @@ func (s *ScreenHome) Init(a *App) {
s.pdsListing.SetLogger(s.Log)
s.jsonContent = wd.NewJsonContent("jsoncontent", s.style)
s.jsonContent.SetLogger(s.Log)
km := s.jsonContent.GetKeyMap()
km.Add(
w.NewKey(w.BuildEK(tcell.KeyEnter), func(ev *tcell.EventKey) bool {
@@ -127,11 +128,21 @@ func (s *ScreenHome) Init(a *App) {
s.Log("Error initializing clipboard: %s", err.Error())
return true
}
clipboard.Write(clipboard.FmtText, []byte(s.jsonContent.GetSelectedValue()))
v, err := s.jsonContent.GetSelectedValue()
if err != nil {
s.Log("Error getting selected value: %s", err.Error())
return true
}
clipboard.Write(clipboard.FmtText, []byte(v))
return true
}),
w.NewKey(w.BuildEKr('O'), func(ev *tcell.EventKey) bool {
url := fmt.Sprintf("https://%s/xrpc/com.atproto.sync.getBlob?did=did:plc:pqwuemo2ic5tqmpwrajb2phi&cid=%s", s.activePds.AtId.String(), s.jsonContent.GetSelectedValue())
v, err := s.jsonContent.GetSelectedValue()
if err != nil {
s.Log("Error getting selected value: %s", err.Error())
return true
}
url := fmt.Sprintf("https://%s/xrpc/com.atproto.sync.getBlob?did=did:plc:pqwuemo2ic5tqmpwrajb2phi&cid=%s", s.activePds.AtId.String(), v)
open.Run(url)
return true
}),