|
|
@@ -23,7 +23,6 @@ const providerMethods = {
|
|
23
|
23
|
const setupPubnub = async uuid => {
|
|
24
|
24
|
const publishKey = 'pub-c-73f35484-396f-47ff-b4b6-45bed079fd3b'
|
|
25
|
25
|
const subscribeKey = 'sub-c-6cb7f5d0-94e2-11ec-b249-a68c05a281ab'
|
|
26
|
|
- // console.log('publishKey: ' , publishKey)
|
|
27
|
26
|
if (!uuid) return console.error('no pubnub uuid set')
|
|
28
|
27
|
|
|
29
|
28
|
const pubnubClient = await new PubNub({
|
|
|
@@ -70,7 +69,7 @@ class Chatter {
|
|
70
|
69
|
this.uuid = null
|
|
71
|
70
|
|
|
72
|
71
|
// Setup the main channel
|
|
73
|
|
- // subscriptions array will be built dynamically from the this.groupings object
|
|
|
72
|
+ // subscriptions array will be built dynamically from the "this.groupings" object
|
|
74
|
73
|
this.subscriptions = [MAIN_CHANNEL, 'Channel-LosAngeles']
|
|
75
|
74
|
this.listeners = {
|
|
76
|
75
|
status: async e => {
|
|
|
@@ -103,8 +102,6 @@ class Chatter {
|
|
103
|
102
|
// step 1: build the this.groupings object from the backend
|
|
104
|
103
|
this.getGroupingsByProfileId(this.uuid)
|
|
105
|
104
|
|
|
106
|
|
- // step 3: subscribe to the this.subscriptions array
|
|
107
|
|
- console.log('this.subscriptions: ', this.subscriptions)
|
|
108
|
105
|
|
|
109
|
106
|
this._listenFor({ listeners: this.listeners })
|
|
110
|
107
|
this._subscribe(this.subscriptions)
|
|
|
@@ -142,7 +139,6 @@ class Chatter {
|
|
142
|
139
|
console.log('fetching groupings for profileId:', profileId)
|
|
143
|
140
|
const groupings = await fetchMembershipsByProfileId(profileId)
|
|
144
|
141
|
this.groupings = groupings
|
|
145
|
|
-
|
|
146
|
142
|
this.createChannelNamesByGroupings(this.groupings)
|
|
147
|
143
|
}
|
|
148
|
144
|
// building a list of channel names from the groupings object.grouping_name
|