Просмотр исходного кода

:memo: Made notes to aid in future refactor

tags/0.0.3^2
tomit4 3 лет назад
Родитель
Сommit
b2ac2d6e9f

+ 3
- 1
frontend/src/components/ProfileCard.vue Просмотреть файл

@@ -66,7 +66,9 @@ import TagList from './TagList.vue'
66 66
 import PairingButton from './PairingButton.vue'
67 67
 
68 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 73
 const props = defineProps({
72 74
     card: {

+ 2
- 0
frontend/src/services/grouping.service.js Просмотреть файл

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

+ 3
- 0
frontend/src/services/notification.service.js Просмотреть файл

@@ -58,6 +58,9 @@ class StonkAlert extends Toaster {
58 58
             const target_desc = parsed.description
59 59
             tagFromNotification[target_desc] = parsed.revealed_info
60 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 64
             foundGrouping.revealedFromNotification.value.push(tagFromNotification)
62 65
         }
63 66
     }

+ 8
- 7
frontend/src/views/ChatView.vue Просмотреть файл

@@ -15,18 +15,19 @@ 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
+            // 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 21
             p you revealed:
20 22
                 span(v-if="grouping.revealed[profile.id.value]")
21 23
                     ul(v-for="reveal in grouping.revealed[profile.id.value]")
22 24
                         li {{ reveal.description }}: {{ profile._profile[reveal.description] }}
23
-            // BUG: they revealed doesn't persist, both for loops are currently necessary
24 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 31
             ul(v-for="revealed in grouping.revealedFromNotification")
31 32
                 li(v-if="revealed[revealed.tag_description] !== profile._profile[revealed.tag_description]") {{ revealed.tag_description }}: {{ revealed[revealed.tag_description] }}
32 33
 

Загрузка…
Отмена
Сохранить