|
|
@@ -3,24 +3,25 @@ main.view--chat.f-col.start.w-full
|
|
3
|
3
|
header
|
|
4
|
4
|
h2 Chat Page
|
|
5
|
5
|
|
|
6
|
|
- article(v-if="!loading && target && profile.isLoggedIn")
|
|
|
6
|
+ article(v-if="profile.isLoggedIn && target")
|
|
7
|
7
|
h3 {{ profile.id }}
|
|
8
|
8
|
span chatting with: {{ target.profile_id }}
|
|
9
|
9
|
p subscriptions: {{ profile.chatter.subscriptions }}
|
|
|
10
|
+ p target: {{ target }}
|
|
10
|
11
|
|
|
|
12
|
+ p(v-else-if="profile.isLoggedIn && !target") No match found between profile {{ $route.params.tid }} and {{profile.id}}...
|
|
11
|
13
|
p(v-else) Loading...
|
|
12
|
14
|
|
|
13
|
15
|
MainNav(@show-sidebar="$emit('show-sidebar')")
|
|
14
|
16
|
</template>
|
|
15
|
17
|
|
|
16
|
18
|
<script>
|
|
17
|
|
-import { fetchProfileByProfileId, currentProfile } from '../services'
|
|
|
19
|
+import { currentProfile } from '../services'
|
|
18
|
20
|
|
|
19
|
21
|
export default {
|
|
20
|
22
|
name: 'ProfileView',
|
|
21
|
23
|
data: () => ({
|
|
22
|
|
- loading: true,
|
|
23
|
|
- target: {},
|
|
|
24
|
+ target: null,
|
|
24
|
25
|
}),
|
|
25
|
26
|
computed: {
|
|
26
|
27
|
profile: () => currentProfile,
|
|
|
@@ -36,15 +37,15 @@ export default {
|
|
36
|
37
|
},
|
|
37
|
38
|
methods: {
|
|
38
|
39
|
async loadTargetProfile() {
|
|
39
|
|
- this.loading = true
|
|
40
|
40
|
try {
|
|
41
|
|
- this.target = await fetchProfileByProfileId(
|
|
42
|
|
- this.$route.params.tid,
|
|
|
41
|
+ const match = this.profile.groupings.find(
|
|
|
42
|
+ grouping =>
|
|
|
43
|
+ grouping.profile.profile_id == this.$route.params.tid,
|
|
43
|
44
|
)
|
|
|
45
|
+ this.target = match.profile
|
|
44
|
46
|
} catch (err) {
|
|
45
|
47
|
console.error(err)
|
|
46
|
48
|
}
|
|
47
|
|
- this.loading = false
|
|
48
|
49
|
},
|
|
49
|
50
|
},
|
|
50
|
51
|
}
|