Browse Source

:memo: Made notes to aid in future refactor

tags/0.0.3^2
tomit4 3 years ago
parent
commit
b2ac2d6e9f

+ 3
- 1
frontend/src/components/ProfileCard.vue View File

66
 import PairingButton from './PairingButton.vue'
66
 import PairingButton from './PairingButton.vue'
67
 
67
 
68
 const router = useRouter()
68
 const router = useRouter()
69
-const isPaired = ref(true)
69
+// NOTE: toggle to use for testing pairing
70
+// const isPaired = ref(true)
71
+const isPaired = ref(false)
70
 
72
 
71
 const props = defineProps({
73
 const props = defineProps({
72
     card: {
74
     card: {

+ 2
- 0
frontend/src/services/grouping.service.js View File

26
                     `/profile/${profileId}/tags/${grouping.grouping_id}`,
26
                     `/profile/${profileId}/tags/${grouping.grouping_id}`,
27
                 )
27
                 )
28
                 grouping.tags = [...targetTags, ...profileTags]
28
                 grouping.tags = [...targetTags, ...profileTags]
29
+                // NOTE: ref([]) allows to re render ChatView.vue revealed info upon reveal,
30
+                // but does not persist...
29
                 grouping.revealedFromNotification = ref([])
31
                 grouping.revealedFromNotification = ref([])
30
                 grouping._loading.value = false
32
                 grouping._loading.value = false
31
                 validGroupingInstances.push(grouping)
33
                 validGroupingInstances.push(grouping)

+ 3
- 0
frontend/src/services/notification.service.js View File

58
             const target_desc = parsed.description
58
             const target_desc = parsed.description
59
             tagFromNotification[target_desc] = parsed.revealed_info
59
             tagFromNotification[target_desc] = parsed.revealed_info
60
             foundGrouping.profile.reveal.push(tagFromNotification)
60
             foundGrouping.profile.reveal.push(tagFromNotification)
61
+            // NOTE: because revealedFromNotification is a ref() in
62
+            // grouping.service.js, ChatView.vue can render revealed info
63
+            // immediately, but will not persist
61
             foundGrouping.revealedFromNotification.value.push(tagFromNotification)
64
             foundGrouping.revealedFromNotification.value.push(tagFromNotification)
62
         }
65
         }
63
     }
66
     }

+ 8
- 7
frontend/src/views/ChatView.vue View File

15
                 button(@click='reveal(8)') reveal my email
15
                 button(@click='reveal(8)') reveal my email
16
                 // TODO: Remove later, only for testing
16
                 // TODO: Remove later, only for testing
17
                 button(@click='checkData()') check data
17
                 button(@click='checkData()') check data
18
-            // BUG: grouping.revealed[profile.id.value] needs to be deduped
18
+            // TODO: Refactor, what if two people have the same name, etc.?
19
+            // NOTE: see notes in services/grouping.service.js and
20
+            // services/notification.service.js
19
             p you revealed:
21
             p you revealed:
20
                 span(v-if="grouping.revealed[profile.id.value]")
22
                 span(v-if="grouping.revealed[profile.id.value]")
21
                     ul(v-for="reveal in grouping.revealed[profile.id.value]")
23
                     ul(v-for="reveal in grouping.revealed[profile.id.value]")
22
                         li {{ reveal.description }}: {{ profile._profile[reveal.description] }}
24
                         li {{ reveal.description }}: {{ profile._profile[reveal.description] }}
23
-            // BUG: they revealed doesn't persist, both for loops are currently necessary
24
             p they revealed:
25
             p they revealed:
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
26
+            // BUG: persists, but doesn't display upon reveal
27
+            span(v-if="grouping.revealed[target.profile_id]")
28
+                ul(v-for="reveal in grouping.revealed[target.profile_id]")
29
+                    li {{ reveal.description }}: {{ target[reveal.description] }}
30
+            // BUG: reveals immediately, but does not persist
30
             ul(v-for="revealed in grouping.revealedFromNotification")
31
             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] }}
32
                 li(v-if="revealed[revealed.tag_description] !== profile._profile[revealed.tag_description]") {{ revealed.tag_description }}: {{ revealed[revealed.tag_description] }}
32
 
33
 

Loading…
Cancel
Save