init
This commit is contained in:
parent
14e88f0c77
commit
2a573a8c83
8 changed files with 249 additions and 1 deletions
144
akkoma-fe/0001-confirm-favorite.patch
Normal file
144
akkoma-fe/0001-confirm-favorite.patch
Normal file
|
@ -0,0 +1,144 @@
|
|||
diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js
|
||||
index d15699f7..e5f1a3c5 100644
|
||||
--- a/src/components/favorite_button/favorite_button.js
|
||||
+++ b/src/components/favorite_button/favorite_button.js
|
||||
@@ -1,41 +1,60 @@
|
||||
-import { mapGetters } from 'vuex'
|
||||
-import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
-import { faStar } from '@fortawesome/free-solid-svg-icons'
|
||||
-import {
|
||||
- faStar as faStarRegular
|
||||
-} from '@fortawesome/free-regular-svg-icons'
|
||||
+import ConfirmModal from "../confirm_modal/confirm_modal.vue";
|
||||
+import { mapGetters } from "vuex";
|
||||
+import { library } from "@fortawesome/fontawesome-svg-core";
|
||||
+import { faStar } from "@fortawesome/free-solid-svg-icons";
|
||||
+import { faStar as faStarRegular } from "@fortawesome/free-regular-svg-icons";
|
||||
|
||||
-library.add(
|
||||
- faStar,
|
||||
- faStarRegular
|
||||
-)
|
||||
+library.add(faStar, faStarRegular);
|
||||
|
||||
const FavoriteButton = {
|
||||
- props: ['status', 'loggedIn'],
|
||||
- data () {
|
||||
+ props: ["status", "loggedIn"],
|
||||
+ components: {
|
||||
+ ConfirmModal,
|
||||
+ },
|
||||
+ data() {
|
||||
return {
|
||||
- animated: false
|
||||
- }
|
||||
+ animated: false,
|
||||
+ showingConfirmDialog: false,
|
||||
+ };
|
||||
},
|
||||
methods: {
|
||||
- favorite () {
|
||||
+ favorite() {
|
||||
+ if (!this.status.favorited && this.shouldConfirmFavorite) {
|
||||
+ this.showConfirmDialog();
|
||||
+ } else {
|
||||
+ this.doFavorite();
|
||||
+ }
|
||||
+ },
|
||||
+ doFavorite() {
|
||||
if (!this.status.favorited) {
|
||||
- this.$store.dispatch('favorite', { id: this.status.id })
|
||||
+ this.$store.dispatch("favorite", { id: this.status.id });
|
||||
} else {
|
||||
- this.$store.dispatch('unfavorite', { id: this.status.id })
|
||||
+ this.$store.dispatch("unfavorite", { id: this.status.id });
|
||||
}
|
||||
- this.animated = true
|
||||
+ this.animated = true;
|
||||
setTimeout(() => {
|
||||
- this.animated = false
|
||||
- }, 500)
|
||||
- }
|
||||
+ this.animated = false;
|
||||
+ }, 500);
|
||||
+ this.hideConfirmDialog();
|
||||
+ },
|
||||
+ showConfirmDialog() {
|
||||
+ this.showingConfirmDialog = true;
|
||||
+ },
|
||||
+ hideConfirmDialog() {
|
||||
+ this.showingConfirmDialog = false;
|
||||
+ },
|
||||
},
|
||||
computed: {
|
||||
- ...mapGetters(['mergedConfig']),
|
||||
- remoteInteractionLink () {
|
||||
- return this.$store.getters.remoteInteractionLink({ statusId: this.status.id })
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
+ ...mapGetters(["mergedConfig"]),
|
||||
+ shouldConfirmFavorite() {
|
||||
+ return this.mergedConfig.modalOnFavorite;
|
||||
+ },
|
||||
+ remoteInteractionLink() {
|
||||
+ return this.$store.getters.remoteInteractionLink({
|
||||
+ statusId: this.status.id,
|
||||
+ });
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
|
||||
-export default FavoriteButton
|
||||
+export default FavoriteButton;
|
||||
diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue
|
||||
index 16bf441e..06ed7d59 100644
|
||||
--- a/src/components/favorite_button/favorite_button.vue
|
||||
+++ b/src/components/favorite_button/favorite_button.vue
|
||||
@@ -32,6 +32,18 @@
|
||||
>
|
||||
{{ status.fave_num }}
|
||||
</span>
|
||||
+ <teleport to="#modal">
|
||||
+ <confirm-modal
|
||||
+ v-if="showingConfirmDialog"
|
||||
+ :title="$t('status.favorite_confirm_title')"
|
||||
+ :confirm-text="$t('status.favorite_confirm_accept_button')"
|
||||
+ :cancel-text="$t('status.favorite_confirm_cancel_button')"
|
||||
+ @accepted="doFavorite"
|
||||
+ @cancelled="hideConfirmDialog"
|
||||
+ >
|
||||
+ {{ $t('status.favorite_confirm') }}
|
||||
+ </confirm-modal>
|
||||
+ </teleport>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
|
||||
index 64950f8a..b09c6d9f 100644
|
||||
--- a/src/components/settings_modal/tabs/general_tab.vue
|
||||
+++ b/src/components/settings_modal/tabs/general_tab.vue
|
||||
@@ -282,6 +282,11 @@
|
||||
{{ $t('settings.confirm_dialogs_repeat') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
+ <li>
|
||||
+ <BooleanSetting path="modalOnFavorite">
|
||||
+ {{ $t('settings.confirm_dialogs_favorite') }}
|
||||
+ </BooleanSetting>
|
||||
+ </li>
|
||||
<li>
|
||||
<BooleanSetting path="modalOnUnfollow">
|
||||
{{ $t('settings.confirm_dialogs_unfollow') }}
|
||||
diff --git a/src/modules/config.js b/src/modules/config.js
|
||||
index 551b5bb6..0e78c749 100644
|
||||
--- a/src/modules/config.js
|
||||
+++ b/src/modules/config.js
|
||||
@@ -83,6 +83,7 @@ export const defaultState = {
|
||||
// This hides statuses filtered via a word filter
|
||||
hideFilteredStatuses: undefined, // instance default
|
||||
modalOnRepeat: undefined, // instance default
|
||||
+ modalOnFavorite: undefined, // instance default
|
||||
modalOnUnfollow: undefined, // instance default
|
||||
modalOnBlock: undefined, // instance default
|
||||
modalOnMute: undefined, // instance default
|
13
akkoma-fe/0002-move-notifications.patch
Normal file
13
akkoma-fe/0002-move-notifications.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/src/components/global_notice_list/global_notice_list.vue b/src/components/global_notice_list/global_notice_list.vue
|
||||
index ddc45b81..492fc4b6 100644
|
||||
--- a/src/components/global_notice_list/global_notice_list.vue
|
||||
+++ b/src/components/global_notice_list/global_notice_list.vue
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
.global-notice-list {
|
||||
position: fixed;
|
||||
- top: 50px;
|
||||
+ bottom: 5px;
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 1001;
|
1
akkoma-fe/upstream.txt
Normal file
1
akkoma-fe/upstream.txt
Normal file
|
@ -0,0 +1 @@
|
|||
7cc6c3565466b330043e0a811a6e1e2db487ec8d
|
Loading…
Add table
Add a link
Reference in a new issue