Don't allow users to set notes on local files

This commit is contained in:
Christian Rocha 2020-07-14 16:16:26 -04:00 committed by Christian Muehlhaeuser
parent 3d1adeec52
commit 7b6c3b3740
2 changed files with 6 additions and 6 deletions

View file

@ -183,8 +183,8 @@ func pagerUpdate(msg tea.Msg, m pagerModel) (pagerModel, tea.Cmd) {
return m, nil
}
case "m":
// Users can't set the note on news markdown
if m.currentDocument.markdownType == newsMarkdown {
// Users can only set the note on user-stashed markdown
if m.currentDocument.markdownType != userMarkdown {
break
}

View file

@ -524,9 +524,9 @@ func stashPopulatedView(m stashModel) string {
func stashHelpView(m stashModel) string {
var (
h []string
md = m.selectedMarkdown()
isNews = md != nil && md.markdownType == newsMarkdown
h []string
md = m.selectedMarkdown()
isStashed = md != nil && md.markdownType == userMarkdown
)
if m.state == stashStateSettingNote {
@ -541,7 +541,7 @@ func stashHelpView(m stashModel) string {
if m.paginator.TotalPages > 1 {
h = append(h, "h/l, ←/→: page")
}
if !isNews && len(m.markdowns) > 0 {
if isStashed && len(m.markdowns) > 0 {
h = append(h, []string{"x: delete", "m: set memo"}...)
}
h = append(h, []string{"esc: exit"}...)