|
|
@@ -15,14 +15,20 @@ main.view--chat
|
|
15
|
15
|
button(@click='reveal(8)') reveal my email
|
|
16
|
16
|
// TODO: Remove later, only for testing
|
|
17
|
17
|
button(@click='checkData()') check data
|
|
|
18
|
+ // BUG: grouping.revealed[profile.id.value] needs to be deduped
|
|
18
|
19
|
p you revealed:
|
|
19
|
20
|
span(v-if="grouping.revealed[profile.id.value]")
|
|
20
|
21
|
ul(v-for="reveal in grouping.revealed[profile.id.value]")
|
|
21
|
|
- li {{ reveal.description }} : {{ profile._profile[reveal.description] }}
|
|
|
22
|
+ li {{ reveal.description }}: {{ profile._profile[reveal.description] }}
|
|
|
23
|
+ // BUG: they revealed doesn't persist, both for loops are currently necessary
|
|
22
|
24
|
p they revealed:
|
|
23
|
|
- span(v-if="theyRevealed")
|
|
24
|
|
- ul(v-for="reveal in theyRevealed")
|
|
25
|
|
- li {{ reveal.description }} : {{ grouping.profile[reveal.description] }}
|
|
|
25
|
+ // BUG: persists, but doesn't display upon reveal
|
|
|
26
|
+ span(v-if="grouping.revealed[target.profile_id]")
|
|
|
27
|
+ ul(v-for="reveal in grouping.revealed[target.profile_id]")
|
|
|
28
|
+ li {{ reveal.description }}: {{ target[reveal.description] }}
|
|
|
29
|
+ // BUG: reveals, but does not persist
|
|
|
30
|
+ ul(v-for="revealed in grouping.revealedFromNotification")
|
|
|
31
|
+ li(v-if="revealed[revealed.tag_description] !== profile._profile[revealed.tag_description]") {{ revealed.tag_description }}: {{ revealed[revealed.tag_description] }}
|
|
26
|
32
|
|
|
27
|
33
|
article
|
|
28
|
34
|
template(v-if='isLoading')
|
|
|
@@ -66,14 +72,13 @@ export default {
|
|
66
|
72
|
toSend: '',
|
|
67
|
73
|
messages: [],
|
|
68
|
74
|
grouping: {},
|
|
|
75
|
+ them: {},
|
|
69
|
76
|
}),
|
|
70
|
77
|
// TODO: Make sure grouping.profile.profile_id actually exists
|
|
71
|
78
|
computed: {
|
|
72
|
79
|
theyRevealed() {
|
|
73
|
|
- return this.grouping && this.grouping.revealed[this.grouping.profile.profile_id] ?
|
|
74
|
|
- this.grouping.revealed[this.grouping.profile.profile_id] :
|
|
75
|
|
- []
|
|
76
|
|
- }
|
|
|
80
|
+ return this.them
|
|
|
81
|
+ },
|
|
77
|
82
|
},
|
|
78
|
83
|
watch: {
|
|
79
|
84
|
async profile() {
|
|
|
@@ -88,6 +93,7 @@ export default {
|
|
88
|
93
|
this.loadTargetProfile()
|
|
89
|
94
|
currentProfile._loading.value = true
|
|
90
|
95
|
this.grouping = this.getGrouping()
|
|
|
96
|
+ this.them = this.grouping.profile
|
|
91
|
97
|
this.messages = await currentProfile.chatter.getHistory(this.grouping.grouping_name)
|
|
92
|
98
|
console.log('this.messages :>> ', this.messages)
|
|
93
|
99
|
currentProfile.chatter.setOnMessage(this._onMessage)
|
|
|
@@ -100,7 +106,7 @@ export default {
|
|
100
|
106
|
},
|
|
101
|
107
|
// TODO: remove, only for testing reveal()
|
|
102
|
108
|
async checkData() {
|
|
103
|
|
- console.log(currentProfile)
|
|
|
109
|
+ console.log('currentProfile :=>', currentProfile)
|
|
104
|
110
|
},
|
|
105
|
111
|
/**
|
|
106
|
112
|
* Pubnub message callback fires when message event
|
|
|
@@ -113,6 +119,9 @@ export default {
|
|
113
|
119
|
},
|
|
114
|
120
|
// TODO: test this
|
|
115
|
121
|
getGrouping() {
|
|
|
122
|
+ if (this.$route.params.pid === currentProfile.profile_id) {
|
|
|
123
|
+ console.warn('WARNING :=> You cannot chat with yourself!!!')
|
|
|
124
|
+ }
|
|
116
|
125
|
return currentProfile.groupings.find(
|
|
117
|
126
|
g => g.profile.profile_id == this.$route.params.pid,
|
|
118
|
127
|
)
|