1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-09-29 04:45:55 -04:00

Enabled viewcache for posts view

This commit is contained in:
マリウス 2023-01-02 18:56:00 -05:00
parent 02a88f4ee9
commit 0714431811
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
2 changed files with 10 additions and 15 deletions

View File

@ -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,

View File

@ -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 {