Przeglądaj źródła

:recycle: Cleaning up refactor a bit, needs another pass

tags/0.0.3^2
tomit4 3 lat temu
rodzic
commit
c249505d02

+ 1
- 11
backend/lib/routes/membership/active.js Wyświetl plik

@@ -75,19 +75,12 @@ module.exports = {
75 75
                 groupings.map(grouping => grouping.grouping_id),
76 76
             )
77 77
 
78
-            // NOTE: Current implementation works okay, it only reveals the targetID's
79
-            // hidden info on the page currently, it does NOT reveal OUR OWN information
80
-            // to ourselves when revealed
81
-
82 78
             /**
83 79
              * Heavily process the result by storing just a profile_id
84 80
              * and attach complete profiles
85 81
              */
86
-            // NOTE: only returns the pId for the target
87 82
             let pIds = groupings.reduce((ids, grouping) => {
88 83
                 grouping.profiles.forEach(p => {
89
-                    // you'd think to comment out here, but it still only returns CompleteProfile of target
90
-                    // pIds would be both currentProfile id and target id though
91 84
                     if (p.profile_id == profileId) return 
92 85
                     ids.push(p.profile_id)
93 86
                     grouping.profile = p.profile_id
@@ -95,14 +88,12 @@ module.exports = {
95 88
                 delete grouping.profiles
96 89
                 return ids
97 90
             }, [])
98
-            console.log('pIds :=>', pIds) // only returns single array of target id
99 91
             /** Assemble complete profiles to reference and pass */
100 92
             const completedProfiles = await profileService.getProfilesFor(
101 93
                 pIds,
102 94
                 'participant',
103 95
                 false,
104 96
             )
105
-
106 97
             // NOTE: Doesn't rely on profile reveal field to get reveal tags
107 98
             const getGroupingRevealTags = async () => {
108 99
                 const groupingRevealTags = []
@@ -142,7 +133,6 @@ module.exports = {
142 133
 
143 134
             const completedProfilesWithRevealedInfo = await getRevealInfo()
144 135
 
145
-            // ISSUE: renders target ID but not currentProfileID in ChatView.vue
146 136
             const reformattedGroupings = groupings.map(g => {
147 137
                 completedProfilesWithRevealedInfo.forEach(p => {
148 138
                     g.profile = g.profile == p.profile_id ? p : g.profile
@@ -152,7 +142,7 @@ module.exports = {
152 142
                 )
153 143
                 return g
154 144
             })
155
-            console.log('reformattedGroupings :=>', reformattedGroupings)
145
+
156 146
             try {
157 147
                 return {
158 148
                     ok: true,

+ 9
- 7
frontend/src/views/ChatView.vue Wyświetl plik

@@ -15,16 +15,18 @@ 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
-            p you revealed:
19
-                span(v-if="grouping.revealed[profile.id.value]")
20
-                    ul(v-for="reveal in grouping.revealed[profile.id.value]")
21
-                        li {{ reveal.description }}: {{ profile._profile[reveal.description] }}
22
-            p they revealed:
18
+            span(v-if="grouping.revealed[profile.id.value]")
19
+                p you revealed: 
20
+                ul(v-for="reveal in grouping.revealed[profile.id.value]")
21
+                    li {{ reveal.description }}
23 22
             span(v-if="grouping.revealed[target.profile_id]")
23
+                p they revealed:
24 24
                 ul(v-for="reveal in grouping.revealed[target.profile_id]")
25 25
                     li {{ reveal.description }}: {{ target[reveal.description] }}
26
-            ul(v-for="revealed in grouping.revealedFromNotification")
27
-                li(v-if="revealed[revealed.tag_description] !== profile._profile[revealed.tag_description]") {{ revealed.tag_description }}: {{ revealed[revealed.tag_description] }}
26
+            span(v-else-if="grouping.revealedFromNotification.length")
27
+                p they revealed:
28
+                ul(v-for="revealed in grouping.revealedFromNotification")
29
+                    li(v-if="revealed[revealed.tag_description] !== profile._profile[revealed.tag_description]") {{ revealed.tag_description }}: {{ revealed[revealed.tag_description] }}
28 30
 
29 31
     article
30 32
         template(v-if='isLoading')

Ładowanie…
Anuluj
Zapisz