mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-11-03 04:27:16 -05:00
Enabled viewcache for posts view
This commit is contained in:
parent
02a88f4ee9
commit
0714431811
@ -118,9 +118,9 @@ func NewModel(c *ctx.Ctx) Model {
|
||||
m.list.SetShowTitle(false)
|
||||
m.list.SetShowStatusBar(false)
|
||||
|
||||
m.textarea = textarea.New()
|
||||
m.textarea.Placeholder = "Type in your reply ..."
|
||||
m.textarea.Prompt = ""
|
||||
// m.textarea = textarea.New()
|
||||
// m.textarea.Placeholder = "Type in your reply ..."
|
||||
// m.textarea.Prompt = ""
|
||||
|
||||
m.a, _ = aggregator.New(m.ctx)
|
||||
|
||||
@ -148,6 +148,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
if ok {
|
||||
// m.ctx.Loading = true
|
||||
// cmds = append(cmds, m.loadItem(&i))
|
||||
m.viewcache = m.buildView(false)
|
||||
cmd := cmd.New(cmd.WinOpen, postshow.WIN_ID, cmd.Arg{
|
||||
Name: "post",
|
||||
Value: &i,
|
||||
|
@ -13,18 +13,12 @@ func (m Model) View() string {
|
||||
func (m Model) buildView(cached bool) string {
|
||||
var view strings.Builder = strings.Builder{}
|
||||
|
||||
// if cached && m.WMisFocused("reply") && m.viewcache != "" {
|
||||
// m.ctx.Logger.Debugln("Cached View()")
|
||||
//
|
||||
// m.textarea.SetWidth(m.viewcacheTextareaXY[2])
|
||||
// m.textarea.SetHeight(m.viewcacheTextareaXY[3])
|
||||
//
|
||||
// return helpers.PlaceOverlay(
|
||||
// m.viewcacheTextareaXY[0], m.viewcacheTextareaXY[1],
|
||||
// m.textarea.View(), m.viewcache,
|
||||
// false)
|
||||
// }
|
||||
//
|
||||
if cached && m.focused == false && m.viewcache != "" {
|
||||
m.ctx.Logger.Debugln("Cached View()")
|
||||
|
||||
return m.viewcache
|
||||
}
|
||||
|
||||
m.ctx.Logger.Debugln("Posts.View()")
|
||||
var l string = ""
|
||||
if m.focused {
|
||||
|
Loading…
Reference in New Issue
Block a user