Social fixes (#6388)

* Disable post button on click

* Remove redundant code
This commit is contained in:
Suraj Shetty 2018-11-02 17:06:56 +05:30 committed by GitHub
parent 5d75f95ec9
commit 4f965c2ea5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
});
}
});