|
|
@@ -12,8 +12,10 @@ main.view--home(style="display:flex; flex-direction:column; gap: 40px; margin-to
|
|
12
|
12
|
|
|
13
|
13
|
p(v-else-if="matches.length===0") No matches.
|
|
14
|
14
|
p(v-else) Loading...
|
|
|
15
|
+ <w-flex class="wrap">
|
|
15
|
16
|
<w-button @click="notify" bg-color="success"> notify </w-button>
|
|
16
|
|
-
|
|
|
17
|
+ <w-button @click="chat" bg-color="error"> chat </w-button>
|
|
|
18
|
+ </w-flex>
|
|
17
|
19
|
</template>
|
|
18
|
20
|
|
|
19
|
21
|
<script>
|
|
|
@@ -21,7 +23,7 @@ main.view--home(style="display:flex; flex-direction:column; gap: 40px; margin-to
|
|
21
|
23
|
import ProfileCardList from '../components/ProfileCardList.vue'
|
|
22
|
24
|
|
|
23
|
25
|
import { Card } from '../entities'
|
|
24
|
|
-import { fetchQueueByProfileId, fetchMembershipsByProfileId } from '../services'
|
|
|
26
|
+import { fetchQueueByProfileId, fetchMembershipsByProfileId, currentProfile } from '../services'
|
|
25
|
27
|
import { mixins } from '../utils'
|
|
26
|
28
|
|
|
27
|
29
|
/** Callback used to format incoming into card */
|
|
|
@@ -71,9 +73,10 @@ export default {
|
|
71
|
73
|
}
|
|
72
|
74
|
this.loading = false
|
|
73
|
75
|
},
|
|
74
|
|
- notify() {
|
|
|
76
|
+ // this can be placed in utils/notification.js
|
|
|
77
|
+ notify(payload) {
|
|
75
|
78
|
this.$waveui.notify({
|
|
76
|
|
- message: 'New Message',
|
|
|
79
|
+ message: payload.timetoken,
|
|
77
|
80
|
timeout: 6000,
|
|
78
|
81
|
bgColor: 'white',
|
|
79
|
82
|
color: 'success',
|
|
|
@@ -84,6 +87,16 @@ export default {
|
|
84
|
87
|
icon: 'wi-star'
|
|
85
|
88
|
})
|
|
86
|
89
|
},
|
|
|
90
|
+ // a way to send a message to a user for development purposes and testing
|
|
|
91
|
+ async chat() {
|
|
|
92
|
+ const chatter = currentProfile.chatter
|
|
|
93
|
+ const res = await chatter.publish(chatter.subscriptions[0],{
|
|
|
94
|
+ title: 'New Message',
|
|
|
95
|
+ description: 'This is a new message',
|
|
|
96
|
+ })
|
|
|
97
|
+ this.notify(res)
|
|
|
98
|
+ }
|
|
|
99
|
+
|
|
87
|
100
|
},
|
|
88
|
101
|
}
|
|
89
|
102
|
</script>
|