client/posts: clear messages before submit
Saving the post twice resulted in two 'Post saved!' messages.
This commit is contained in:
parent
9ee973ce1c
commit
3176709288
|
@ -102,6 +102,7 @@ class PostController {
|
|||
|
||||
_evtPostEdit(e) {
|
||||
this._view.sidebarControl.disableForm();
|
||||
this._view.sidebarControl.clearMessages();
|
||||
const post = e.detail.post;
|
||||
if (e.detail.tags !== undefined) {
|
||||
post.tags = e.detail.tags;
|
||||
|
|
|
@ -182,6 +182,10 @@ class PostEditSidebarControl extends events.EventTarget {
|
|||
views.disableForm(this._formNode);
|
||||
}
|
||||
|
||||
clearMessages() {
|
||||
views.clearMessages(this._hostNode);
|
||||
}
|
||||
|
||||
showSuccess(message) {
|
||||
views.showSuccess(this._hostNode, message);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue