|
|
@@ -36,6 +36,7 @@ section.profile-card-list
|
|
36
|
36
|
h4 {{ profile.name }}
|
|
37
|
37
|
nav.swipe_icons
|
|
38
|
38
|
button(@click="view(profile.pid)") view
|
|
|
39
|
+ button(@click="chat(profile.pid)") chat
|
|
39
|
40
|
</template>
|
|
40
|
41
|
|
|
41
|
42
|
<script setup>
|
|
|
@@ -44,6 +45,7 @@ import {
|
|
44
|
45
|
updateQueueByProfileId,
|
|
45
|
46
|
fetchMembershipsByProfileId,
|
|
46
|
47
|
postMembershipByProfileId,
|
|
|
48
|
+ currentProfile,
|
|
47
|
49
|
} from '../services'
|
|
48
|
50
|
|
|
49
|
51
|
const router = useRouter()
|
|
|
@@ -102,6 +104,25 @@ const accept = async () => {
|
|
102
|
104
|
const view = pid => {
|
|
103
|
105
|
router.push({ path: `/matches/${pid}` })
|
|
104
|
106
|
}
|
|
|
107
|
+const chat = pid => {
|
|
|
108
|
+
|
|
|
109
|
+ const chatter = currentProfile.chatter
|
|
|
110
|
+ // chatter._listenFor('hello_world')
|
|
|
111
|
+ chatter._subscribe(['hello_world'])
|
|
|
112
|
+ chatter.publish({
|
|
|
113
|
+ channel: "hello_world",
|
|
|
114
|
+ message: {"text": "This is my first realtime message!"}
|
|
|
115
|
+ }).then((publishResponse) => {
|
|
|
116
|
+ console.log(publishResponse);
|
|
|
117
|
+ });
|
|
|
118
|
+
|
|
|
119
|
+
|
|
|
120
|
+
|
|
|
121
|
+
|
|
|
122
|
+
|
|
|
123
|
+console.log('chatter', chatter.subscriptions)
|
|
|
124
|
+ //router.push({ path: `/chat/${pid}` })
|
|
|
125
|
+}
|
|
105
|
126
|
const pass = () => {
|
|
106
|
127
|
const targetId = props.profiles[0].pid
|
|
107
|
128
|
updateQueueByProfileId(props.pid, targetId, true)
|