Social fixes (#6388)
* Disable post button on click * Remove redundant code
This commit is contained in:
parent
5d75f95ec9
commit
4f965c2ea5
1 changed files with 3 additions and 0 deletions
|
|
@ -42,11 +42,14 @@ frappe.social.post_dialog = new frappe.ui.Dialog({
|
|||
],
|
||||
primary_action_label: __('Post'),
|
||||
primary_action: (values) => {
|
||||
frappe.social.post_dialog.disable_primary_action();
|
||||
const post = frappe.model.get_new_doc('Post');
|
||||
post.content = values.content;
|
||||
frappe.db.insert(post).then(() => {
|
||||
frappe.social.post_dialog.clear();
|
||||
frappe.social.post_dialog.hide();
|
||||
}).finally(() => {
|
||||
frappe.social.post_dialog.enable_primary_action();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue