Skip to content

Commit 5b2dce5

Browse files
peterpolmanpeterpolman
authored andcommitted
THX-6 - Fixes issues with reward sorting and camera image upload
1 parent 284b8bc commit 5b2dce5

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/components/Reward.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
</span>
3434
</div>
35-
3635
<small>{{reward.startTime | moment("MMMM Do YYYY HH:mm") }}</small>
3736
</div>
3837

@@ -79,7 +78,6 @@
7978
</button>
8079

8180
<template slot="footer">
82-
8381
<template v-if="isManager">
8482
<div class="row" v-if="now < reward.endTime">
8583
<div class="col-md-6" v-if="!reward.hasVoted">
@@ -93,8 +91,8 @@
9391
</button>
9492
</div>
9593
<div class="col-md-12" v-if="reward.hasVoted">
96-
<button @click="revokeVote()" :class="{ disabled: reward.loading }" class="btn btn-primary btn-block">
97-
Revoke
94+
<button @click="revokeVote()" :class="{ disabled: reward.loading }" class="btn btn-link btn-block">
95+
Revoke your vote
9896
</button>
9997
</div>
10098
</div>

src/services/PoolService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default class PoolService extends Vue {
163163
}
164164

165165
public async revokeVoteForReward(reward: Reward, pool: RewardPool) {
166-
return await this.callPoolMethod(reward.contract.methods.revokeVote(reward.id), pool);
166+
return await this.callPoolMethod(reward.contract.methods.revokeVote(reward.beneficiaryAddress), pool);
167167
}
168168

169169
public async voteForReward(reward: Reward, pool: RewardPool, agree: boolean) {

src/views/Camera.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default class Camera extends Vue {
3131
}
3232

3333
private async onDecode(decodedString: string) {
34-
console.log(decodedString);
3534
if (decodedString.length > 0) {
3635
this.data = JSON.parse(decodedString);
3736
this.error = '';

src/views/Camera.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</template>
4141

4242
<div class="ui-file">
43-
<qrcode-capture @decode="onDecode"></qrcode-capture>
43+
<qrcode-capture :capture="false" :multiple="false" @decode="onDecode"></qrcode-capture>
4444
<small>Upload QR code image if the camera does not work on your device.</small>
4545
</div>
4646

src/views/Pool.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ export default class PoolDetail extends Vue {
8888
}
8989

9090
get sortedRewards() {
91-
return _.orderBy(this.rewards.filter((reward: Reward) => {
91+
const filtered = this.rewards.filter((reward: Reward) => {
9292
const isMyReward = (reward.beneficiaryAddress)
9393
? reward.beneficiaryAddress.toLowerCase() === this.$network.extdev.account
9494
: false;
9595
return (reward.state === 'Pending') || ((reward.state === 'Approved') && isMyReward) || ((reward.state === 'Withdrawn') && isMyReward);
96-
}), 'startTime', 'asc');
96+
});
97+
return _.orderBy(filtered, 'startTime', 'desc');
9798
}
9899

99100
public created() {

0 commit comments

Comments
 (0)