git ssb

3+

dangerousbeans / scuttle-vue



Commit bdb6f71a74ac41de0e712971826b6f349b5ecaaa

replies

Joran committed on 11/15/2017, 7:05:22 AM
Parent: a1fd2964043759cd471502cf6084997679bf384c

Files changed

modules/thread.jschanged
src/components/Message.vuechanged
modules/thread.jsView
@@ -38,8 +38,10 @@
3838 exports.create = function (api) {
3939
4040 return {
4141 getThread: function (root, cb) {
42 +
43 + // debugger
4244 //in this case, it's inconvienent that panel only takes
4345 //a stream. maybe it would be better to accept an array?
4446 api.sbot_get(root, function (err, value) {
4547 if (err) return cb(err)
src/components/Message.vueView
@@ -1,8 +1,8 @@
11
22 <template>
3- <div class="media">
4- <img class="mr-3 rounded " style="max-width: 60px; " :src="image_url">
3 + <div class="media mt-3 col-sm-8">
4 + <img class="pr-3 rounded " style="max-width: 60px; " :src="image_url">
55 <div class="media-body col-sm-9">
66 <h5 class="mt-0 text-truncate">{{ author }}</h5>
77
88 <span v-if="" class="text-truncate" v-html="content_text()"></span>
@@ -10,8 +10,13 @@
1010 <p>
1111 {{ message.value.content.type() }}
1212 </p>
1313 </div>
14 +
15 + {{ relatedMessages.length }} replies:
16 + <message v-for="message in relatedMessages" :message="message">
17 + </message>
18 +
1419 <hr/>
1520 </div>
1621 </template>
1722
@@ -29,9 +34,9 @@
2934 data () {
3035 return {
3136 author: "...",
3237 image_url: "http://via.placeholder.com/90x90",
33- relatedMessages: {}
38 + relatedMessages: []
3439 }
3540 },
3641
3742 methods: {
@@ -41,16 +46,17 @@
4146 this.author = nn( a[0] ).name()
4247 },
4348
4449 setRelatedMessages(err, a){
45- // debugger
50 +
4651 if(err) {
4752 console.log('message.vue.setRelatedMessages.err', err)
4853 }
49- if(a === null) { return }
54 + // console.log(a)
5055
5156 // debugger
52- this.relatedMessages = a
57 + if(a)
58 + this.relatedMessages = a.every(function(e){ nn(e) })
5359 },
5460
5561 // Get markdown formatted version of message content
5662 content_text()

Built with git-ssb-web