hide attestation button

-fix button padding
-fix response on logout request
-fix cursor when disabled fieldset
This commit is contained in:
Danil Kovtonyuk 2020-02-29 14:28:00 +10:00
parent 32eb117a0f
commit 49b87d51b3
3 changed files with 23 additions and 7 deletions

View File

@ -79,6 +79,7 @@
.box {
background-color: $primary-invert;
border-color: #393939;
cursor: inherit;
.title {
color: $white;
@ -148,4 +149,15 @@
margin-bottom: $block-spacing;
}
}
> .buttons {
&:not(:last-child) {
margin-bottom: 0;
}
.button {
margin-bottom: 2rem;
}
}
}

View File

@ -42,7 +42,7 @@
Make the contribution
</b-button>
<b-button
v-if="status.type === 'is-success'"
v-if="status.type === 'is-success' && contributionType !== 'anonymous'"
@click="makeTweet"
type="is-primary"
tag="a"
@ -160,14 +160,17 @@ export default {
body: formData
})
if (resp.ok) {
this.status.msg =
'Your contribution is verified and recorded. Now you can post attestation from your twitter account.'
this.status.type = 'is-success'
const responseData = await resp.json()
this.$store.commit('user/SET_CONTRIBUTION_INDEX', responseData.contributionIndex)
console.log(
`${window.location.origin}/authorize-contribution?token=${responseData.token}`
)
this.status.msg = 'Your contribution is verified and recorded.'
this.status.type = 'is-success'
if (this.contributionType === 'anonymous') {
console.log(
`${window.location.origin}/authorize-contribution?token=${responseData.token}`
)
} else {
this.status.msg += ' Now you can post attestation from your twitter account.'
}
} else if (resp.status === 422) {
if (retry < 3) {
console.log(`Looks like someone else uploaded contribution ahead of us, retrying`)

View File

@ -176,6 +176,7 @@ router.get('/user_data/', (req, res) => {
router.get('/logout', (req, res) => {
req.session.destroy()
res.send('OK')
})
module.exports = router