Skip to content

Commit

Permalink
Checks if there is a request to subscribe to enable the sign button
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicios-gomes committed May 13, 2021
1 parent 4867c36 commit 33efdc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/views/LibresignTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
:icon="icon"
:name="name">
<div v-show="showButtons" class="buttons">
<button class="primary" @click="option('sign')">
<button class="primary" :disabled="!hasSign" @click="option('sign')">
{{ t('libresign', 'Sign') }}
</button>
<button
Expand Down Expand Up @@ -99,6 +99,7 @@ export default {
disabledSign: false,
info: this.fileInfo,
canRequestSign: false,
canSign: false,
}
},
Expand All @@ -112,6 +113,9 @@ export default {
hasSignatures() {
return !!(this.canRequestSign && this.signatures)
},
hasSign() {
return !!this.canSign
},
},
created() {
Expand All @@ -123,6 +127,8 @@ export default {
try {
const response = await axios.get(generateUrl(`/apps/libresign/api/0.1/file/validate/file_id/${this.fileInfo.id}`))
this.canRequestSign = response.data.settings.canRequestSign
this.canSign = response.data.settings.canSign
} catch (err) {
this.canRequestSign = err.response.data.settings.canRequestSign
}
Expand Down

0 comments on commit 33efdc0

Please sign in to comment.