diff --git a/changelog.d/drafts.fix b/changelog.d/drafts.fix new file mode 100644 index 000000000..f209455c5 --- /dev/null +++ b/changelog.d/drafts.fix @@ -0,0 +1 @@ +Fixed drafts creating duplicates on edit instead of updating diff --git a/src/App.js b/src/App.js index ed3d43e4a..ae38204b6 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,4 @@ -import { throttle } from 'lodash' +import { throttle } from 'lodash-es' import { mapState } from 'pinia' import { defineAsyncComponent } from 'vue' @@ -49,6 +49,12 @@ export default { MobilePostStatusButton, MobileNav, DesktopNav, + FollowRequestConfirm: defineAsyncComponent( + () => + import( + 'src/components/follow_request_confirm/follow_request_confirm.vue' + ), + ), SettingsModal: defineAsyncComponent( () => import('src/components/settings_modal/settings_modal.vue'), ), diff --git a/src/App.vue b/src/App.vue index bd19c5c10..cad329a78 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,6 +75,7 @@ + diff --git a/src/api/helpers.js b/src/api/helpers.js index f23960ed9..6afd20468 100644 --- a/src/api/helpers.js +++ b/src/api/helpers.js @@ -1,4 +1,4 @@ -import { snakeCase } from 'lodash' +import { snakeCase } from 'lodash-es' import { StatusCodeError } from 'src/services/errors/errors' diff --git a/src/api/user.js b/src/api/user.js index d3a2a4a70..2f356ebbc 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,4 +1,4 @@ -import { last } from 'lodash' +import { last } from 'lodash-es' import { paramsString, promisedRequest } from './helpers.js' import { fetchFriends, MASTODON_STATUS_URL } from './public.js' @@ -43,9 +43,10 @@ export const MASTODON_FOLLOW_URL = (id) => `/api/v1/accounts/${id}/follow` export const MASTODON_UNFOLLOW_URL = (id) => `/api/v1/accounts/${id}/unfollow` const MASTODON_FOLLOW_REQUESTS_URL = '/api/v1/follow_requests' -const MASTODON_APPROVE_USER_URL = (id) => +export const MASTODON_APPROVE_USER_URL = (id) => `/api/v1/follow_requests/${id}/authorize` -const MASTODON_DENY_USER_URL = (id) => `/api/v1/follow_requests/${id}/reject` +export const MASTODON_DENY_USER_URL = (id) => + `/api/v1/follow_requests/${id}/reject` const MASTODON_USER_RELATIONSHIPS_URL = ({ id, withSuspended }) => `/api/v1/accounts/relationships/${paramsString({ id, withSuspended })}` export const MASTODON_USER_IN_LISTS = (id) => `/api/v1/accounts/${id}/lists` diff --git a/src/components/chat_message_list/chat_message_list.js b/src/components/chat_message_list/chat_message_list.js index a51e6a0e4..6aef4336b 100644 --- a/src/components/chat_message_list/chat_message_list.js +++ b/src/components/chat_message_list/chat_message_list.js @@ -1,4 +1,4 @@ -import { orderBy, uniqueId } from 'lodash' +import { orderBy, uniqueId } from 'lodash-es' import ChatMessage from 'src/components/chat_message/chat_message.vue' diff --git a/src/components/chat_view/chat_view.js b/src/components/chat_view/chat_view.js index a0abcb5fe..7d80459bb 100644 --- a/src/components/chat_view/chat_view.js +++ b/src/components/chat_view/chat_view.js @@ -1,4 +1,4 @@ -import { get, maxBy, minBy, sortBy, throttle } from 'lodash' +import { get, maxBy, minBy, sortBy, throttle } from 'lodash-es' import { mapState } from 'pinia' import { nextTick } from 'vue' diff --git a/src/components/color_input/color_input.vue b/src/components/color_input/color_input.vue index 53396f532..821a1be0e 100644 --- a/src/components/color_input/color_input.vue +++ b/src/components/color_input/color_input.vue @@ -64,7 +64,7 @@ diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js index c244a8cb3..f6c79ac76 100644 --- a/src/components/gallery/gallery.js +++ b/src/components/gallery/gallery.js @@ -1,4 +1,4 @@ -import { set, sumBy } from 'lodash' +import { set, sumBy } from 'lodash-es' import Attachment from 'src/components/attachment/attachment.vue' diff --git a/src/components/list/list.js b/src/components/list/list.js index 8abf02fd6..2283f5260 100644 --- a/src/components/list/list.js +++ b/src/components/list/list.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash' +import { isEmpty } from 'lodash-es' import Checkbox from 'src/components/checkbox/checkbox.vue' diff --git a/src/components/lists_user_search/lists_user_search.js b/src/components/lists_user_search/lists_user_search.js index 22568135a..4dde2f589 100644 --- a/src/components/lists_user_search/lists_user_search.js +++ b/src/components/lists_user_search/lists_user_search.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash' +import { debounce } from 'lodash-es' import Checkbox from 'src/components/checkbox/checkbox.vue' diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js index 0ffab6f78..3fbd9b77b 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.js +++ b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash' +import { debounce } from 'lodash-es' import { mapState } from 'pinia' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js index 9b948e306..73bf6e515 100644 --- a/src/components/moderation_tools/moderation_tools.js +++ b/src/components/moderation_tools/moderation_tools.js @@ -1,4 +1,4 @@ -import { last } from 'lodash' +import { last } from 'lodash-es' import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue' import Popover from 'src/components/popover/popover.vue' diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js index 7f2a16186..c3530975e 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js @@ -1,4 +1,4 @@ -import { get } from 'lodash' +import { get } from 'lodash-es' import { mapState } from 'pinia' import { useInstanceStore } from 'src/stores/instance.js' diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 51b60fb29..cff7f655f 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -1,5 +1,4 @@ -import { mapState } from 'pinia' -import { defineAsyncComponent } from 'vue' +import { mapActions, mapState } from 'pinia' import Report from 'src/components/report/report.vue' import StatusContent from 'src/components/status_content/status_content.vue' @@ -16,13 +15,10 @@ import { import { useFollowRequestsStore } from 'src/stores/follow_requests.js' import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { useNotificationsStore } from 'src/stores/notifications.js' -import { useOAuthStore } from 'src/stores/oauth.js' import { useStatusesStore } from 'src/stores/statuses.js' import { useUserHighlightStore } from 'src/stores/user_highlight.js' import { useUsersStore } from 'src/stores/users.js' -import { approveUser, denyUser } from 'src/api/user.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import { library } from '@fortawesome/fontawesome-svg-core' @@ -58,8 +54,6 @@ const Notification = { selecting: false, statusExpanded: false, unmuted: false, - showingApproveConfirmDialog: false, - showingDenyConfirmDialog: false, } }, props: ['notification'], @@ -73,9 +67,6 @@ const Notification = { UserPopover, UserLink, - ConfirmModal: defineAsyncComponent( - () => import('src/components/confirm_modal/confirm_modal.vue'), - ), }, mounted() { document.addEventListener('selectionchange', this.onContentSelect) @@ -125,51 +116,7 @@ const Notification = { toggleMute() { this.unmuted = !this.unmuted }, - showApproveConfirmDialog() { - this.showingApproveConfirmDialog = true - }, - hideApproveConfirmDialog() { - this.showingApproveConfirmDialog = false - }, - showDenyConfirmDialog() { - this.showingDenyConfirmDialog = true - }, - hideDenyConfirmDialog() { - this.showingDenyConfirmDialog = false - }, - approveUser() { - if (this.shouldConfirmApprove) { - this.showApproveConfirmDialog() - } else { - this.doApprove() - } - }, - doApprove() { - approveUser({ - id: this.user.id, - credentials: useOAuthStore().token, - }) - useFollowRequestsStore().remove(this.user.id) - useNotificationsStore().markSingleNotificationAsSeen(this.notification.id) - this.hideApproveConfirmDialog() - }, - denyUser() { - if (this.shouldConfirmDeny) { - this.showDenyConfirmDialog() - } else { - this.doDeny() - } - }, - doDeny() { - denyUser({ - id: this.user.id, - credentials: useOAuthStore().token, - }).then(() => { - useNotificationsStore().dismissNotificationLocal(this.notification.id) - useFollowRequestsStore().remove(this.user.id) - }) - this.hideDenyConfirmDialog() - }, + ...mapActions(useFollowRequestsStore, ['approve', 'deny']), }, computed: { status() { @@ -220,12 +167,6 @@ const Notification = { scaleMfm() { return this.mergedConfig.scaleMfm }, - shouldConfirmApprove() { - return this.mergedConfig.modalOnApproveFollow - }, - shouldConfirmDeny() { - return this.mergedConfig.modalOnDenyFollow - }, ...mapState(useUsersStore, ['currentUser']), }, } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 601e574db..156c9ac11 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -226,7 +226,7 @@