Merge pull request 'Add visual feedback when clicking translate' (#423) from ilja/akkoma-fe:provide_visual_feedback_when_clicking_translate_button into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #423
This commit is contained in:
commit
ad6bb47003
2 changed files with 7 additions and 2 deletions
|
@ -41,7 +41,8 @@ const StatusContent = {
|
|||
postLength: this.status.text.length,
|
||||
parseReadyDone: false,
|
||||
renderMisskeyMarkdown,
|
||||
translateFrom: null
|
||||
translateFrom: null,
|
||||
translating: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -135,7 +136,10 @@ const StatusContent = {
|
|||
},
|
||||
translateStatus () {
|
||||
const translateTo = this.$store.getters.mergedConfig.translationLanguage || this.$store.state.instance.interfaceLanguage
|
||||
this.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom })
|
||||
this.translating = true
|
||||
this.$store.dispatch(
|
||||
'translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom }
|
||||
).finally(() => { this.translating = false })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
{{ ' ' }}
|
||||
<button
|
||||
class="btn button-default"
|
||||
:disabled="translating"
|
||||
@click="translateStatus"
|
||||
>
|
||||
{{ $t('status.translate') }}
|
||||
|
|
Loading…
Reference in a new issue