Merge pull request #9883 from Alchez/dev-chat-notification

fix: notification improvements to Chat (develop)
This commit is contained in:
mergify[bot] 2020-04-14 13:54:04 +00:00 committed by GitHub
commit 2c03ecb8fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1566,7 +1566,11 @@ class extends Component {
const alert = // TODO: ellipses content
`
<span data-action="show-message" class="cursor-pointer">
<span class="indicator yellow"/> <b>${frappe.user.first_name(r.user)}</b>: ${r.content}
<span class="indicator yellow"/>
<span class="avatar avatar-small">
<span class="avatar-frame" style="background-image: url(${frappe.user.image(r.user)})"></span>
</span>
<b>${frappe.user.first_name(r.user)}</b>: ${r.content}
</span>
`
frappe.show_alert(alert, 15, {
@ -1575,6 +1579,11 @@ class extends Component {
this.base.firstChild._component.toggle()
}.bind(this, r)
})
frappe.notify(`${frappe.user.first_name(r.user)}`, {
body: r.content,
icon: frappe.user.image(r.user),
tag: r.user
})
}
if ( r.room === state.room.name ) {