diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2023-10-29 16:26:05 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2023-10-29 16:26:05 +0000 |
| commit | b6accf9e7f7ef5f23cbf8bac57e54cefa0db4620 (patch) | |
| tree | 91d6db4e663dfa8f94991032220fd415a5612d17 /src/components/retweet_button/retweet_button.js | |
| parent | 321a131c20d83b0a7061c2b4600c4d77dec5b7fe (diff) | |
| parent | f685f9021bfaff71616efd8e83d114441e69701b (diff) | |
Merge branch 'develop' into 'master'
Update master branch
See merge request pleroma/pleroma-fe!1861
Diffstat (limited to 'src/components/retweet_button/retweet_button.js')
| -rw-r--r-- | src/components/retweet_button/retweet_button.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index 4d92b5fa..198b6c14 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -1,3 +1,4 @@ +import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faRetweet, @@ -15,13 +16,24 @@ library.add( const RetweetButton = { props: ['status', 'loggedIn', 'visibility'], + components: { + ConfirmModal + }, data () { return { - animated: false + animated: false, + showingConfirmDialog: false } }, methods: { retweet () { + if (!this.status.repeated && this.shouldConfirmRepeat) { + this.showConfirmDialog() + } else { + this.doRetweet() + } + }, + doRetweet () { if (!this.status.repeated) { this.$store.dispatch('retweet', { id: this.status.id }) } else { @@ -31,6 +43,13 @@ const RetweetButton = { setTimeout(() => { this.animated = false }, 500) + this.hideConfirmDialog() + }, + showConfirmDialog () { + this.showingConfirmDialog = true + }, + hideConfirmDialog () { + this.showingConfirmDialog = false } }, computed: { @@ -39,6 +58,9 @@ const RetweetButton = { }, remoteInteractionLink () { return this.$store.getters.remoteInteractionLink({ statusId: this.status.id }) + }, + shouldConfirmRepeat () { + return this.mergedConfig.modalOnRepeat } } } |
