mirror of
https://github.com/mrusme/superhighway84.git
synced 2024-11-05 06:01:04 +00:00
Fixed #30, validation triggers at a later stage
This commit is contained in:
parent
0723ec3379
commit
a89946d46b
@ -93,10 +93,6 @@ func (t *TUI) OpenArticle(article *models.Article, readOnly bool) (models.Articl
|
|||||||
|
|
||||||
newArticle.Body = strings.TrimSpace(content[1])
|
newArticle.Body = strings.TrimSpace(content[1])
|
||||||
|
|
||||||
if valid, err := newArticle.IsValid(); valid == false {
|
|
||||||
return *article, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return newArticle, nil
|
return newArticle, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,6 +420,11 @@ func(mainscreen *Mainscreen) submitNewArticle(group string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if valid, err := updatedNewArticle.IsValid(); valid == false {
|
||||||
|
mainscreen.T.ShowErrorModal(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
mainscreen.T.ShowModal(
|
mainscreen.T.ShowModal(
|
||||||
"Do you want to submit this new article?",
|
"Do you want to submit this new article?",
|
||||||
map[string]ModalButton{
|
map[string]ModalButton{
|
||||||
@ -462,6 +467,11 @@ func(mainscreen *Mainscreen) replyToArticle(article *models.Article) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if valid, err := updatedNewArticle.IsValid(); valid == false {
|
||||||
|
mainscreen.T.ShowErrorModal(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
mainscreen.T.ShowModal(
|
mainscreen.T.ShowModal(
|
||||||
"Do you want to submit this reply?",
|
"Do you want to submit this reply?",
|
||||||
map[string]ModalButton{
|
map[string]ModalButton{
|
||||||
|
Loading…
Reference in New Issue
Block a user