mirror of
https://git.notfire.cc/notfire/akkoma-fe.git
synced 2026-01-11 13:33:24 -08:00
Merge pull request 'Add visual feedback when clicking translate' (#423) from ilja/akkoma-fe:provide_visual_feedback_when_clicking_translate_button into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma-fe/pulls/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…
Add table
Add a link
Reference in a new issue