Skip to content

Commit

Permalink
Adjust vote notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Greateck committed Feb 6, 2019
1 parent c7daa36 commit 18b97c2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
30 changes: 28 additions & 2 deletions components/ReportModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
</button>
</div>
<vue-markdown class="modal-body" v-html="body"></vue-markdown>
<div class="report-comments">
</div>
</div>
</div>
</div>
</template>

<script>
import VueMarkdown from 'vue-markdown'
import steem from 'steem'
export default {
watch: {
report : 'fetchComments'
},
props: ['report'],
components: {
VueMarkdown,
Expand All @@ -43,7 +49,27 @@
let user_name = /(@([\a-zA-Z0-9-.]+)(?![\a-zA-Z0-9-.]))([,.|() ])/g;
return report_content.replace(user_name,'[$1](https://busy.org/$1)$3')
}
}
},
methods: {
fetchComments () {
//handles grabbing related comments to current post
if (typeof this.report != undefined && this.report != 'undefined' && this.report != null){
console.log(this.report);
//getState allows fetching all related comments to the post at hand. Yet we need to build the proper param to it under the format '/tag/username/permlink'
let report_param = this.report.category + '/@' + this.report.author + '/' + this.report.permlink;
let cur_ref = this;
steem.api.getState (report_param, function (err, result){
//sort results by depth so as we display entries properly
let comments_found = Object.values(result.content).sort( function (comment_a, comment_b){
return comment_a.depth < comment_b.depth? -1:1;
});
//go through sorted items, skip depth 0 as that's the current post
console.log(err, comments_found);
const comments = [];
});
}
},
}
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion components/VoteModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
// notify the user that he received an additional reward
this.$notify({
group: 'success',
text: 'You\'ve been rewarded '+outcome.amount + ' AFIT tokens for upvoting a min of 3 Actifit reports at 20%. Congrats!',
text: 'You\'ve been rewarded '+outcome.amount + ' AFIT tokens for upvoting 3 Actifit reports at 20% voting power or more. Congrats!',
position: 'top center'
})
}
Expand Down

0 comments on commit 18b97c2

Please sign in to comment.