~chrisppy/beagles

6dc3959ec9159d294635f974f10cda86c50d343e — Chris Palmer 10 months ago 17d4b0b rewrite
Fix add in unread
2 files changed, 26 insertions(+), 0 deletions(-)

M atom.go
M ui.go
M atom.go => atom.go +6 -0
@@ 175,10 175,16 @@ func (a *app) parseAtom(b []byte, feedPath string) (newFeed *barefeed.Feed, newE

		linked.Entries[entry.EntryID] = entry
		if isEntryNew {
			if newEntries == nil {
				newEntries = make(map[string]barefeed.Entry)
			}
			newEntries[entry.EntryID] = entry
		}
	}

	// Update all data in FeedMap for this feed
	a.FeedMap[feedID] = linked

	return
}


M ui.go => ui.go +20 -0
@@ 239,8 239,28 @@ func (a *app) addFeed(args []string) {
			for _, e := range newEntries {
				a.addUnreadEntry(e)
			}

			a.UI.CommandLine.SetText("")
			switch a.UI.Status {
			case helpStatus:
				a.UI.StatusLine.SetText(helpLabel)
				a.UI.Application.SetFocus(a.UI.HelpPanel.Content)
			case subscriptionContentStatus:
				a.UI.StatusLine.SetText(contentLabel)
				a.UI.Application.SetFocus(a.UI.SubscriptionPanel.Content)
			case subscriptionTreeStatus:
				a.UI.StatusLine.SetText(subscriptionLabel)
				a.UI.Application.SetFocus(a.UI.SubscriptionPanel.Tree)
			case unreadContentStatus:
				a.UI.StatusLine.SetText(contentLabel)
				a.UI.Application.SetFocus(a.UI.UnreadPanel.Content)
			case unreadListStatus:
				a.UI.StatusLine.SetText(unreadLabel)
				a.UI.Application.SetFocus(a.UI.UnreadPanel.List)
			}
		}

		a.UI.Updating = false
	})

}