Work
This commit is contained in:
@@ -149,7 +149,12 @@ func (a *App) PostEvent(ev tcell.Event) error {
|
||||
func (a *App) Sync() { a.tScreen.Sync() }
|
||||
func (a *App) ClearScreen() { a.tScreen.Clear() }
|
||||
func (a *App) Exit() { a.running = false }
|
||||
func (a *App) Cleanup() { a.tScreen.Fini() }
|
||||
func (a *App) Cleanup() {
|
||||
a.running = false
|
||||
a.tScreen.Sync()
|
||||
a.tScreen.Clear()
|
||||
a.tScreen.Fini()
|
||||
}
|
||||
|
||||
func (a *App) GetRepo() *data.Repo { return a.repo }
|
||||
|
||||
|
||||
@@ -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
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user