Skip to content

Commit

Permalink
add support for charity info display + refactor links use to envt var
Browse files Browse the repository at this point in the history
  • Loading branch information
Greateck committed Jan 7, 2019
1 parent a1b4823 commit 1b6e28f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
21 changes: 18 additions & 3 deletions components/Report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@
</small>
</div>
</div>
<!-- adding section to display charity info if available -->
<div class="row details mt-2 text-brand full-afit-txt" v-if="this.meta.charity">
<div class="col-8">
<i class="fas fa-dove"></i>
<small>
Charity Post
</small>
<i class="fas fa-dove"></i>
</div>
<div class="col-4 text-right">
<small>
<a :href="'https://busy.org/@' + this.meta.charity[0]" target="_blank">@{{this.meta.charity[0]}}</a>
</small>
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -200,16 +215,16 @@
}
},
async mounted () {
fetch('https://actifitbot.herokuapp.com/getPostReward?user=' + this.report.author+'&url='+this.report.url).then(res => {
fetch(process.env.actiAppUrl+'getPostReward?user=' + this.report.author+'&url='+this.report.url).then(res => {
//grab the post's reward to display it properly
res.json().then(json => this.afitReward = json.token_count)}).catch(e => reject(e))
//grab the author's rank
fetch('https://actifitbot.herokuapp.com/getRank/' + this.report.author).then(res => {
fetch(process.env.actiAppUrl+'getRank/' + this.report.author).then(res => {
res.json().then(json => this.userRank = json.user_rank)}).catch(e => reject(e))
//grab post full pay if full pay mode enabled
fetch('https://actifitbot.herokuapp.com/getPostFullAFITPayReward?user=' + this.report.author+'&url='+this.report.url).then(res => {
fetch(process.env.actiAppUrl+'getPostFullAFITPayReward?user=' + this.report.author+'&url='+this.report.url).then(res => {
res.json().then(json => this.fullAFITReward = json.token_count)}).catch(e => reject(e))
},
Expand Down
2 changes: 1 addition & 1 deletion pages/signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
//grab AFIT price
fetch('https://actifitbot.herokuapp.com/curAFITPrice').then(
fetch(process.env.actiAppUrl+'curAFITPrice').then(
res => {res.json().then(json => this.setAFITPrice (json.unit_price_usd)).catch(e => reject(e))
}).catch(e => reject(e))
Expand Down
22 changes: 11 additions & 11 deletions store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,42 @@ import steem from 'steem'
export default {
fetchUserTokens ({ state, commit }) {
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/user/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
fetch(process.env.actiAppUrl+'user/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
res.json().then(json => commit('setUserTokens', json.tokens)).catch(e => reject(e))
}).catch(e => reject(e))
})
},
fetchUserReportCount ({ state, commit }) {
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/userRewardedPostCount/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
fetch(process.env.actiAppUrl+'userRewardedPostCount/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
res.json().then(json => commit('setUserReportCount', json.rewarded_post_count)).catch(e => reject(e))
}).catch(e => reject(e))
})
},
fetchTransactions ({ state, commit }) {
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/transactions/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
fetch(process.env.actiAppUrl+'transactions/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
res.json().then(json => commit('setTransactions', json || [])).catch(e => reject(e))
}).catch(e => reject(e))
})
},
fetchReferrals ({ state, commit }) {
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/signups/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
fetch(process.env.actiAppUrl+'signups/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
res.json().then(json => commit('setReferrals', json || [])).catch(e => reject(e))
}).catch(e => reject(e))
})
},
fetchUserRank ({ state, commit }) {
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/getRank/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
fetch(process.env.actiAppUrl+'getRank/' + state.steemconnect.user.account.name.toLowerCase()).then(res => {
res.json().then(json => commit('setUserRank', json.user_rank)).catch(e => reject(e))
}).catch(e => reject(e))
})
},
fetchTopDelegators ({ state, commit }, maxCount){
return new Promise((resolve, reject) => {
var targetUrl = 'https://actifitbot.herokuapp.com/topDelegators';
var targetUrl = process.env.actiAppUrl+'topDelegators';
if (Number.isInteger(maxCount)){
targetUrl += '?count='+maxCount;
}
Expand All @@ -52,14 +52,14 @@ export default {
},
fetchModerators ({ commit }){
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/moderators').then(res => {
fetch(process.env.actiAppUrl+'moderators').then(res => {
res.json().then(json => commit('setModerators', json || [])).catch(e => reject(e))
}).catch(e => reject(e))
})
},
fetchAmbassadors ({ commit }){
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/ambassadors').then(res => {
fetch(process.env.actiAppUrl+'ambassadors').then(res => {
res.json().then(json => commit('setAmbassadors', json || [])).catch(e => reject(e))
}).catch(e => reject(e))
})
Expand All @@ -68,7 +68,7 @@ export default {
commit('setUserCount', 0) // reset to trigger animation again
commit('setTokensDistributed', 0) // reset to trigger animation again
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/user-tokens-info').then(res => {
fetch(process.env.actiAppUrl+'user-tokens-info').then(res => {
res.json().then(json => {
commit('setUserCount', json[0].user_count)
commit('setTokensDistributed', json[0].tokens_distributed)
Expand All @@ -79,7 +79,7 @@ export default {
fetchRewardedActivityCount ({ commit }) {
commit('setRewardedActivityCount', 0) // reset to trigger animation again
return new Promise((resolve, reject) => {
fetch('https://actifitbot.herokuapp.com/rewarded-activity-count').then(res => {
fetch(process.env.actiAppUrl+'rewarded-activity-count').then(res => {
res.json().then(json => {
commit('setRewardedActivityCount', json[0].reward_count)
}).catch(e => reject(e))
Expand Down Expand Up @@ -109,7 +109,7 @@ export default {

//grab list of banned users first
let bannedUsers = [];
fetch('https://actifitbot.herokuapp.com/banned_users').then(res => {
fetch(process.env.actiAppUrl+'banned_users').then(res => {
res.json().then(json => {
bannedUsers = json;

Expand Down

0 comments on commit 1b6e28f

Please sign in to comment.