platypush/platypush/backend/http/webapp/src/components/Pushbullet.vue

33 lines
561 B
Vue
Raw Normal View History

2020-11-28 01:12:47 +01:00
<template>
<div />
</template>
<script>
import Utils from "@/Utils";
export default {
mixins: [Utils],
methods: {
onMessage(event) {
this.notify({
title: event.title,
text: event.body,
image: {
src: event.icon ? 'data:image/png;base64, ' + event.icon : undefined,
icon: event.icon ? undefined : 'bell',
},
})
2020-11-28 01:12:47 +01:00
},
},
mounted() {
this.subscribe(
this.onMessage,
null,
'platypush.message.event.pushbullet.PushbulletNotificationEvent'
)
2020-11-28 01:12:47 +01:00
},
}
</script>