diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 692e71fd5..6c607eeea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,7 @@ test: e2e-pleroma: stage: test - image: mcr.microsoft.com/playwright:v1.57.0-jammy + image: mcr.microsoft.com/playwright:v1.61.0-jammy services: - name: postgres:15-alpine alias: db diff --git a/.woodpecker/test-e2e.yaml b/.woodpecker/test-e2e.yaml index a5289bd78..2a7d1511d 100644 --- a/.woodpecker/test-e2e.yaml +++ b/.woodpecker/test-e2e.yaml @@ -25,7 +25,7 @@ variables: steps: test: - image: mcr.microsoft.com/playwright:v1.57.0-jammy + image: mcr.microsoft.com/playwright:v1.61.0-jammy entrypoint: *script_file_entrypoint environment: APT_CACHE_DIR: apt-cache diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index acc48aacc..89f6f2f93 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -25,7 +25,7 @@ variables: steps: test: - image: mcr.microsoft.com/playwright:v1.57.0-jammy + image: mcr.microsoft.com/playwright:v1.61.0-jammy environment: APT_CACHE_DIR: apt-cache DEBIAN_FRONTEND: noninteractive diff --git a/biome.json b/biome.json index 6a464a0e5..5ef6f79ee 100644 --- a/biome.json +++ b/biome.json @@ -46,6 +46,7 @@ "noUnusedLabels": "error", "noUnusedPrivateClassMembers": "error", "noUnusedVariables": "error", + "noUnusedImports": "error", "useIsNan": "error", "useValidForDirection": "error", "useValidTypeof": "error", diff --git a/build/sw_plugin.js b/build/sw_plugin.js index f278d55f6..2f0a4819d 100644 --- a/build/sw_plugin.js +++ b/build/sw_plugin.js @@ -1,4 +1,3 @@ -import { readFile } from 'node:fs/promises' import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { exactRegex } from '@rolldown/pluginutils' diff --git a/docker/e2e/Dockerfile.e2e b/docker/e2e/Dockerfile.e2e index e84359ceb..7e3fbfbf1 100644 --- a/docker/e2e/Dockerfile.e2e +++ b/docker/e2e/Dockerfile.e2e @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/playwright:v1.57.0-jammy +FROM mcr.microsoft.com/playwright:v1.61.0-jammy WORKDIR /app diff --git a/src/App.js b/src/App.js index ea2271a75..7de7a0696 100644 --- a/src/App.js +++ b/src/App.js @@ -21,9 +21,6 @@ import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { useShoutStore } from 'src/stores/shout.js' -import messages from 'src/i18n/messages' -import localeService from 'src/services/locale/locale.service.js' - // Helper to unwrap reactive proxies window.toValue = (x) => JSON.parse(JSON.stringify(x)) diff --git a/src/api/admin.js b/src/api/admin.js index 975a7386e..79eac9bd6 100644 --- a/src/api/admin.js +++ b/src/api/admin.js @@ -1,7 +1,5 @@ import { promisedRequest } from './helpers.js' -import { RegistrationError, StatusCodeError } from 'src/services/errors/errors' - const REPORTS = '/api/v1/pleroma/admin/reports' const CONFIG_URL = '/api/v1/pleroma/admin/config' const DESCRIPTIONS_URL = '/api/v1/pleroma/admin/config/descriptions' diff --git a/src/api/helpers.js b/src/api/helpers.js index 5fb11a183..40b879232 100644 --- a/src/api/helpers.js +++ b/src/api/helpers.js @@ -1,6 +1,6 @@ import { snakeCase } from 'lodash' -import { RegistrationError, StatusCodeError } from 'src/services/errors/errors' +import { StatusCodeError } from 'src/services/errors/errors' export const paramsString = (params = {}) => { if (params == null || params === undefined) return '' diff --git a/src/api/oauth.js b/src/api/oauth.js index b774b3f6c..f0fd2950d 100644 --- a/src/api/oauth.js +++ b/src/api/oauth.js @@ -1,5 +1,3 @@ -import { reduce } from 'lodash' - import { paramsString, promisedRequest } from './helpers.js' const REDIRECT_URI = `${window.location.origin}/oauth-callback` diff --git a/src/api/public.js b/src/api/public.js index bd3f56fce..e001ba749 100644 --- a/src/api/public.js +++ b/src/api/public.js @@ -1,13 +1,11 @@ import { paramsString, promisedRequest } from './helpers.js' +import { MASTODON_USER_TIMELINE_URL } from './timelines.js' import { - parseLinkHeaderPagination, - parseNotification, parseSource, parseStatus, parseUser, } from 'src/services/entity_normalizer/entity_normalizer.service.js' -import { RegistrationError, StatusCodeError } from 'src/services/errors/errors' const MASTODON_SUGGESTIONS_URL = '/api/v1/suggestions' const MASTODON_LOGIN_URL = '/api/v1/accounts/verify_credentials' @@ -15,15 +13,6 @@ const MASTODON_REGISTRATION_URL = '/api/v1/accounts' const MASTODON_PASSWORD_RESET_URL = ({ email }) => `/auth/password${paramsString({ email })}` -const MASTODON_USER_NOTIFICATIONS_URL = ({ - minId, - sinceId, - maxId, - limit, - includeTypes, - replyVisibility, -}) => - `/api/v1/notifications${paramsString({ minId, sinceId, maxId, limit, includeTypes, replyVisibility })}` const MASTODON_FOLLOWING_URL = ( id, { minId, maxId, sinceId, limit, withRelationships }, @@ -35,84 +24,6 @@ const MASTODON_FOLLOWERS_URL = ( ) => `/api/v1/accounts/${id}/followers${paramsString({ minId, maxId, sinceId, limit, withRelationships })}` -const MASTODON_USER_HOME_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/timelines/home${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_LIST_TIMELINE_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/timelines/list/${id}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_DIRECT_MESSAGES_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/timelines/direct${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_PUBLIC_TIMELINE = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, - local, - remote, - onlyMedia, -}) => - `/api/v1/timelines/public${paramsString({ minId, sinceId, maxId, limit, replyVisibility, local, remote, onlyMedia })}` -const MASTODON_TAG_TIMELINE_URL = ( - tag, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/timelines/tag/${tag}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_USER_TIMELINE_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia }, -) => - `/api/v1/accounts/${id}/statuses${paramsString({ minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia })}` -const MASTODON_USER_FAVORITES_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const MASTODON_BOOKMARK_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, - folderId, -}) => - `/api/v1/bookmarks${paramsString({ minId, sinceId, maxId, limit, replyVisibility, folderId })}` -const PLEROMA_STATUS_QUOTES_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/pleroma/statuses/${id}/quotes${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const PLEROMA_USER_FAVORITES_TIMELINE_URL = ( - id, - { minId, sinceId, maxId, limit, replyVisibility }, -) => - `/api/v1/pleroma/accounts/${id}/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` -const AKKOMA_BUBBLE_TIMELINE_URL = ({ - minId, - sinceId, - maxId, - limit, - replyVisibility, -}) => - `/api/v1/timelines/bubble${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` - export const MASTODON_STATUS_URL = (id) => `/api/v1/statuses/${id}` const MASTODON_STATUS_CONTEXT_URL = (id) => `/api/v1/statuses/${id}/context` const MASTODON_STATUS_SOURCE_URL = (id) => `/api/v1/statuses/${id}/source` @@ -231,38 +142,26 @@ export const fetchConversation = ({ id, credentials }) => promisedRequest({ url: MASTODON_STATUS_CONTEXT_URL(id), credentials, - }) - .then((result) => ({ - ...result, - data: { - ...result.data, - ancestors: result.data.ancestors.map(parseStatus), - descendants: result.data.descendants.map(parseStatus), - }, - })) - .catch((error) => { - throw new Error('Error fetching timeline', error) - }) + }).then((result) => ({ + ...result, + data: { + ...result.data, + ancestors: result.data.ancestors.map(parseStatus), + descendants: result.data.descendants.map(parseStatus), + }, + })) export const fetchStatus = ({ id, credentials }) => promisedRequest({ url: MASTODON_STATUS_URL(id), credentials, - }) - .then(({ data, ...rest }) => ({ ...rest, data: parseStatus(data) })) - .catch((error) => { - throw new Error('Error fetching timeline', error) - }) + }).then(({ data, ...rest }) => ({ ...rest, data: parseStatus(data) })) export const fetchStatusSource = ({ id, credentials }) => promisedRequest({ url: MASTODON_STATUS_SOURCE_URL(id), credentials, - }) - .then(({ data, ...rest }) => ({ ...rest, data: parseSource(data) })) - .catch((error) => { - throw new Error('Error fetching timeline', error) - }) + }).then(({ data, ...rest }) => ({ ...rest, data: parseSource(data) })) export const fetchStatusHistory = ({ status, credentials }) => promisedRequest({ @@ -275,109 +174,6 @@ export const fetchStatusHistory = ({ status, credentials }) => }) }) -export const fetchTimeline = ({ - timeline, - credentials, - sinceId, - minId, - maxId, - userId, - listId, - statusId, - tag, - withMuted, - replyVisibility = 'all', - includeTypes = [], - bookmarkFolderId, -}) => { - const timelineUrls = { - friends: MASTODON_USER_HOME_TIMELINE_URL, - public: MASTODON_PUBLIC_TIMELINE, - publicAndExternal: MASTODON_PUBLIC_TIMELINE, - dms: MASTODON_DIRECT_MESSAGES_TIMELINE_URL, - user: MASTODON_USER_TIMELINE_URL, - media: MASTODON_USER_TIMELINE_URL, - list: MASTODON_LIST_TIMELINE_URL, - favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, - publicFavorites: PLEROMA_USER_FAVORITES_TIMELINE_URL, - bookmarks: MASTODON_BOOKMARK_TIMELINE_URL, - bubble: AKKOMA_BUBBLE_TIMELINE_URL, - tag: MASTODON_TAG_TIMELINE_URL, - quotes: PLEROMA_STATUS_QUOTES_URL, - - notifications: MASTODON_USER_NOTIFICATIONS_URL, - } - const urlFunc = timelineUrls[timeline] - - const twoArgs = new Set([ - 'user', - 'media', - 'list', - 'publicFavorites', - 'tag', - 'quotes', - ]) - - const params = { - minId, - sinceId, - maxId, - limit: 20, - } - - const id = (() => { - switch (timeline) { - case 'user': - case 'media': - return userId - case 'list': - return listId - case 'quotes': - return statusId - case 'tag': - return tag - } - })() - - const isNotifications = timeline === 'notifications' - - if (timeline === 'media') { - params.onlyMedia = true - } - if (timeline === 'public') { - params.local = true - } - if (timeline !== 'favorites' && timeline !== 'bookmarks') { - params.withMuted = withMuted - } - if (replyVisibility !== 'all') { - params.replyVisibility = replyVisibility - } - if (timeline === 'bookmarks' && bookmarkFolderId) { - params.folderId = bookmarkFolderId - } - - if (isNotifications && includeTypes.length > 0) { - params.includeTypes = includeTypes - } - - const url = twoArgs.has(timeline) ? urlFunc(id, params) : urlFunc(params) - return promisedRequest({ url, credentials }).then((result) => { - const pagination = parseLinkHeaderPagination( - result.response.headers.get('Link'), - { - flakeId: timeline !== 'bookmarks' && timeline !== 'notifications', - }, - ) - - return { - ...result, - data: result.data.map(isNotifications ? parseNotification : parseStatus), - pagination, - } - }) -} - export const listEmojiPacks = ({ page, pageSize, credentials }) => promisedRequest({ url: EMOJI_PACKS_URL(page, pageSize), @@ -467,15 +263,11 @@ export const search2 = ({ withRelationships: true, }), credentials, + }).then(({ data, ...rest }) => { + data.accounts = data.accounts.slice(0, limit).map((u) => parseUser(u)) + data.statuses = data.statuses.slice(0, limit).map((s) => parseStatus(s)) + return { ...rest, data } }) - .then(({ data, ...rest }) => { - data.accounts = data.accounts.slice(0, limit).map((u) => parseUser(u)) - data.statuses = data.statuses.slice(0, limit).map((s) => parseStatus(s)) - return { ...rest, data } - }) - .catch((error) => { - throw new Error('Error fetching timeline', error) - }) } export const fetchKnownDomains = ({ credentials }) => diff --git a/src/api/timelines.js b/src/api/timelines.js new file mode 100644 index 000000000..0679b1eec --- /dev/null +++ b/src/api/timelines.js @@ -0,0 +1,198 @@ +import { paramsString, promisedRequest } from './helpers.js' + +import { + parseLinkHeaderPagination, + parseNotification, + parseStatus, +} from 'src/services/entity_normalizer/entity_normalizer.service.js' + +const MASTODON_USER_HOME_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/timelines/home${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_LIST_TIMELINE_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/timelines/list/${id}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_DIRECT_MESSAGES_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/timelines/direct${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_PUBLIC_TIMELINE = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, + local, + remote, + onlyMedia, +}) => + `/api/v1/timelines/public${paramsString({ minId, sinceId, maxId, limit, replyVisibility, local, remote, onlyMedia })}` +const MASTODON_TAG_TIMELINE_URL = ( + tag, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/timelines/tag/${tag}${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +export const MASTODON_USER_TIMELINE_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia }, +) => + `/api/v1/accounts/${id}/statuses${paramsString({ minId, sinceId, maxId, limit, replyVisibility, pinned, onlyMedia })}` +const MASTODON_USER_FAVORITES_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const MASTODON_BOOKMARK_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, + folderId, +}) => + `/api/v1/bookmarks${paramsString({ minId, sinceId, maxId, limit, replyVisibility, folderId })}` +const PLEROMA_STATUS_QUOTES_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/pleroma/statuses/${id}/quotes${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const PLEROMA_USER_FAVORITES_TIMELINE_URL = ( + id, + { minId, sinceId, maxId, limit, replyVisibility }, +) => + `/api/v1/pleroma/accounts/${id}/favourites${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` +const AKKOMA_BUBBLE_TIMELINE_URL = ({ + minId, + sinceId, + maxId, + limit, + replyVisibility, +}) => + `/api/v1/timelines/bubble${paramsString({ minId, sinceId, maxId, limit, replyVisibility })}` + +const MASTODON_USER_NOTIFICATIONS_URL = ({ + minId, + sinceId, + maxId, + limit, + includeTypes, + replyVisibility, +}) => + `/api/v1/notifications${paramsString({ minId, sinceId, maxId, limit, includeTypes, replyVisibility })}` + +export const fetchTimeline = ({ + timeline, + credentials, + sinceId, + minId, + maxId, + userId, + listId, + statusId, + tag, + withMuted, + replyVisibility = 'all', + includeTypes = [], + bookmarkFolderId, +}) => { + const timelineUrls = { + friends: MASTODON_USER_HOME_TIMELINE_URL, + public: MASTODON_PUBLIC_TIMELINE, + publicAndExternal: MASTODON_PUBLIC_TIMELINE, + dms: MASTODON_DIRECT_MESSAGES_TIMELINE_URL, + user: MASTODON_USER_TIMELINE_URL, + media: MASTODON_USER_TIMELINE_URL, + list: MASTODON_LIST_TIMELINE_URL, + favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, + publicFavorites: PLEROMA_USER_FAVORITES_TIMELINE_URL, + bookmarks: MASTODON_BOOKMARK_TIMELINE_URL, + bubble: AKKOMA_BUBBLE_TIMELINE_URL, + tag: MASTODON_TAG_TIMELINE_URL, + quotes: PLEROMA_STATUS_QUOTES_URL, + + notifications: MASTODON_USER_NOTIFICATIONS_URL, + } + const urlFunc = timelineUrls[timeline] + + const twoArgs = new Set([ + 'user', + 'media', + 'list', + 'publicFavorites', + 'tag', + 'quotes', + ]) + + const params = { + minId, + sinceId, + maxId, + limit: 20, + } + + const id = (() => { + switch (timeline) { + case 'user': + case 'media': + return userId + case 'list': + return listId + case 'quotes': + return statusId + case 'tag': + return tag + } + })() + + const isNotifications = timeline === 'notifications' + + if (timeline === 'media') { + params.onlyMedia = true + } + if (timeline === 'public') { + params.local = true + } + if (timeline !== 'favorites' && timeline !== 'bookmarks') { + params.withMuted = withMuted + } + if (replyVisibility !== 'all') { + params.replyVisibility = replyVisibility + } + if (timeline === 'bookmarks' && bookmarkFolderId) { + params.folderId = bookmarkFolderId + } + + if (isNotifications && includeTypes.length > 0) { + params.includeTypes = includeTypes + } + + const url = twoArgs.has(timeline) ? urlFunc(id, params) : urlFunc(params) + return promisedRequest({ url, credentials }).then((result) => { + const pagination = parseLinkHeaderPagination( + result.response.headers.get('Link'), + { + flakeId: timeline !== 'bookmarks' && timeline !== 'notifications', + }, + ) + + return { + ...result, + data: result.data.map(isNotifications ? parseNotification : parseStatus), + pagination, + } + }) +} diff --git a/src/api/websocket.js b/src/api/websocket.js index 44f3d391a..d952372e5 100644 --- a/src/api/websocket.js +++ b/src/api/websocket.js @@ -1,4 +1,4 @@ -import { paramsString, promisedRequest } from './helpers.js' +import { paramsString } from './helpers.js' import { parseChat, diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 95fb3e9ea..0b4825ca0 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -28,7 +28,6 @@ import { } from '../services/window_utils/window_utils' import routes from './routes' -import { useAnnouncementsStore } from 'src/stores/announcements' import { useAuthFlowStore } from 'src/stores/auth_flow' import { useEmojiStore } from 'src/stores/emoji.js' import { useI18nStore } from 'src/stores/i18n' diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 4b733258f..d5bce12a7 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -2,7 +2,6 @@ import { mapState } from 'pinia' import { defineAsyncComponent } from 'vue' import Popover from 'src/components/popover/popover.vue' -import VideoAttachment from 'src/components/video_attachment/video_attachment.vue' import nsfwImage from '../../assets/nsfw.png' import { useInstanceStore } from 'src/stores/instance.js' diff --git a/src/components/chat_message/chat_message.js b/src/components/chat_message/chat_message.js index ba06172ed..2066a8194 100644 --- a/src/components/chat_message/chat_message.js +++ b/src/components/chat_message/chat_message.js @@ -1,6 +1,5 @@ import { mapState as mapPiniaState } from 'pinia' -import { defineAsyncComponent } from 'vue' -import { mapGetters, mapState } from 'vuex' +import { mapState } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' import ChatMessageDate from 'src/components/chat_message_date/chat_message_date.vue' diff --git a/src/components/chat_new/chat_new.js b/src/components/chat_new/chat_new.js index ec2656e5c..0ee4e292b 100644 --- a/src/components/chat_new/chat_new.js +++ b/src/components/chat_new/chat_new.js @@ -5,8 +5,6 @@ import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import { useOAuthStore } from 'src/stores/oauth.js' -import { chats } from 'src/api/chats.js' - import { library } from '@fortawesome/fontawesome-svg-core' import { faChevronLeft, faSearch } from '@fortawesome/free-solid-svg-icons' diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js index 52d4445b6..1d12384cc 100644 --- a/src/components/chat_title/chat_title.js +++ b/src/components/chat_title/chat_title.js @@ -1,5 +1,3 @@ -import { defineAsyncComponent } from 'vue' - import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import UserPopover from 'src/components/user_popover/user_popover.vue' diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index c9a6abcf1..fe8e9e105 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -1,5 +1,3 @@ -import { useEmojiStore } from 'src/stores/emoji.js' - /** * suggest - generates a suggestor function to be used by emoji-input * data: object providing source information for specific types of suggestions: diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index bc2bb092b..6889fb8b0 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -6,7 +6,6 @@ import Popover from 'src/components/popover/popover.vue' import { ensureFinalFallback } from '../../i18n/languages.js' import { useEmojiStore } from 'src/stores/emoji.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' import { library } from '@fortawesome/fontawesome-svg-core' diff --git a/src/components/lists_menu/lists_menu_content.js b/src/components/lists_menu/lists_menu_content.js index d96f14599..337ee4d4f 100644 --- a/src/components/lists_menu/lists_menu_content.js +++ b/src/components/lists_menu/lists_menu_content.js @@ -4,7 +4,6 @@ import { mapState } from 'vuex' import { getListEntries } from 'src/components/navigation/filter.js' import NavigationEntry from 'src/components/navigation/navigation_entry.vue' -import { useInstanceStore } from 'src/stores/instance.js' import { useListsStore } from 'src/stores/lists.js' export const ListsMenuContent = { diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index a00db03cf..a333e6970 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -1,4 +1,4 @@ -import { mapActions, mapState as mapPiniaState, mapStores } from 'pinia' +import { mapActions, mapState as mapPiniaState } from 'pinia' import { mapState } from 'vuex' import { useAuthFlowStore } from 'src/stores/auth_flow.js' diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index ad53b6e31..fe5994f7c 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -1,7 +1,6 @@ import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' -import StillImage from 'src/components/still-image/still-image.vue' import GestureService from '../../services/gesture_service/gesture_service' import { useMediaViewerStore } from 'src/stores/media_viewer.js' diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 877e83c12..48f6d1d8e 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -1,6 +1,5 @@ import { mapState as mapPiniaState } from 'pinia' -import { defineAsyncComponent } from 'vue' -import { mapGetters, mapState } from 'vuex' +import { mapState } from 'vuex' import UnicodeDomainIndicator from 'src/components/unicode_domain_indicator/unicode_domain_indicator.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js index b819c72aa..ca4852ab3 100644 --- a/src/components/moderation_tools/moderation_tools.js +++ b/src/components/moderation_tools/moderation_tools.js @@ -4,7 +4,6 @@ import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue' import Popover from 'src/components/popover/popover.vue' import { useAdminSettingsStore } from 'src/stores/admin_settings.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { library } from '@fortawesome/fontawesome-svg-core' diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index c564355f3..4d9c34546 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -1,7 +1,6 @@ import { debounce, map, reject, uniqBy } from 'lodash' import { mapActions, mapState } from 'pinia' import { defineAsyncComponent } from 'vue' -import { mapGetters } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' import Checkbox from 'src/components/checkbox/checkbox.vue' diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index 6011281cf..973c2b1a5 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -1,5 +1,4 @@ import { get } from 'lodash' -import { defineAsyncComponent } from 'vue' import Modal from 'src/components/modal/modal.vue' import PostStatusForm from 'src/components/post_status_form/post_status_form.vue' diff --git a/src/components/quote/quote.js b/src/components/quote/quote.js index 3b771b3f2..439d3440a 100644 --- a/src/components/quote/quote.js +++ b/src/components/quote/quote.js @@ -1,5 +1,3 @@ -import { defineAsyncComponent } from 'vue' - import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' diff --git a/src/components/settings_modal/admin_tabs/admin_user_card.js b/src/components/settings_modal/admin_tabs/admin_user_card.js index a075db010..ba0f0e9f7 100644 --- a/src/components/settings_modal/admin_tabs/admin_user_card.js +++ b/src/components/settings_modal/admin_tabs/admin_user_card.js @@ -1,5 +1,3 @@ -import { defineAsyncComponent } from 'vue' - import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue' import ModerationTools from 'src/components/moderation_tools/moderation_tools.vue' diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.js b/src/components/settings_modal/admin_tabs/emoji_tab.js index f64128c57..56361587d 100644 --- a/src/components/settings_modal/admin_tabs/emoji_tab.js +++ b/src/components/settings_modal/admin_tabs/emoji_tab.js @@ -2,7 +2,7 @@ import Checkbox from 'components/checkbox/checkbox.vue' import Popover from 'components/popover/popover.vue' import Select from 'components/select/select.vue' import StillImage from 'components/still-image/still-image.vue' -import { assign, clone } from 'lodash' +import { clone } from 'lodash' import { defineAsyncComponent } from 'vue' import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' diff --git a/src/components/settings_modal/admin_tabs/users_tab.js b/src/components/settings_modal/admin_tabs/users_tab.js index ab40c723a..68bc46aa2 100644 --- a/src/components/settings_modal/admin_tabs/users_tab.js +++ b/src/components/settings_modal/admin_tabs/users_tab.js @@ -1,5 +1,3 @@ -import { isEmpty } from 'lodash' - import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue' import Checkbox from 'src/components/checkbox/checkbox.vue' import List from 'src/components/list/list.vue' diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index b9ff08bb5..3b76708fe 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -5,7 +5,6 @@ import LocalSettingIndicator from './local_setting_indicator.vue' import ModifiedIndicator from './modified_indicator.vue' import { useAdminSettingsStore } from 'src/stores/admin_settings.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useLocalConfigStore } from 'src/stores/local_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/settings_modal/helpers/vertical_tab_switcher.jsx b/src/components/settings_modal/helpers/vertical_tab_switcher.jsx index cbe1be158..61ed6bee1 100644 --- a/src/components/settings_modal/helpers/vertical_tab_switcher.jsx +++ b/src/components/settings_modal/helpers/vertical_tab_switcher.jsx @@ -1,8 +1,7 @@ // eslint-disable-next-line no-unused -import { throttle } from 'lodash' -import { mapState as mapPiniaState, mapState } from 'pinia' -import { Fragment, h } from 'vue' +import { mapState as mapPiniaState } from 'pinia' +import { Fragment } from 'vue' import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome' diff --git a/src/components/settings_modal/settings_modal_admin_content.js b/src/components/settings_modal/settings_modal_admin_content.js index fb2d26778..22ba0e16c 100644 --- a/src/components/settings_modal/settings_modal_admin_content.js +++ b/src/components/settings_modal/settings_modal_admin_content.js @@ -1,4 +1,3 @@ -import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' import AuthTab from './admin_tabs/auth_tab.vue' import EmojiTab from './admin_tabs/emoji_tab.vue' import FederationTab from './admin_tabs/federation_tab.vue' diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index bed6f6500..3ab3846d2 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -8,7 +8,6 @@ import FloatSetting from '../helpers/float_setting.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import UnitSetting from '../helpers/unit_setting.vue' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useLocalConfigStore } from 'src/stores/local_config.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js index 781412249..c45d6ad76 100644 --- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js +++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js @@ -1,4 +1,4 @@ -import { get, isEmpty, map, reject } from 'lodash' +import { get, map, reject } from 'lodash' import Autosuggest from 'src/components/autosuggest/autosuggest.vue' import BlockCard from 'src/components/block_card/block_card.vue' diff --git a/src/components/settings_modal/tabs/posts_tab.js b/src/components/settings_modal/tabs/posts_tab.js index dbf284d93..640ba5084 100644 --- a/src/components/settings_modal/tabs/posts_tab.js +++ b/src/components/settings_modal/tabs/posts_tab.js @@ -6,7 +6,6 @@ import SharedComputedObject from '../helpers/shared_computed_object.js' import UnitSetting from '../helpers/unit_setting.vue' import { useLocalConfigStore } from 'src/stores/local_config.js' -import { useSyncConfigStore } from 'src/stores/sync_config.js' const PostsTab = { data() { diff --git a/src/components/settings_modal/tabs/security_tab/mfa.js b/src/components/settings_modal/tabs/security_tab/mfa.js index 20c28419d..1277b42ec 100644 --- a/src/components/settings_modal/tabs/security_tab/mfa.js +++ b/src/components/settings_modal/tabs/security_tab/mfa.js @@ -1,5 +1,4 @@ import VueQrcode from '@chenfengyuan/vue-qrcode' -import { mapState } from 'vuex' import Confirm from './confirm.vue' import RecoveryCodes from './mfa_backup_codes.vue' diff --git a/src/components/settings_modal/tabs/security_tab/mfa_totp.js b/src/components/settings_modal/tabs/security_tab/mfa_totp.js index bbe06c217..2c4c194bc 100644 --- a/src/components/settings_modal/tabs/security_tab/mfa_totp.js +++ b/src/components/settings_modal/tabs/security_tab/mfa_totp.js @@ -1,5 +1,3 @@ -import { mapState } from 'vuex' - import Confirm from './confirm.vue' import { useOAuthStore } from 'src/stores/oauth.js' diff --git a/src/components/settings_modal/tabs/security_tab/security_tab.js b/src/components/settings_modal/tabs/security_tab/security_tab.js index 45876f848..a2571bd54 100644 --- a/src/components/settings_modal/tabs/security_tab/security_tab.js +++ b/src/components/settings_modal/tabs/security_tab/security_tab.js @@ -2,7 +2,6 @@ import Checkbox from 'src/components/checkbox/checkbox.vue' import ProgressButton from 'src/components/progress_button/progress_button.vue' import Mfa from './mfa.vue' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useOAuthStore } from 'src/stores/oauth.js' import { useOAuthTokensStore } from 'src/stores/oauth_tokens' diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js index 840beeb7c..27e9a5249 100644 --- a/src/components/side_drawer/side_drawer.js +++ b/src/components/side_drawer/side_drawer.js @@ -1,5 +1,4 @@ import { mapActions, mapState } from 'pinia' -import { defineAsyncComponent } from 'vue' import { mapGetters } from 'vuex' import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js' diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js index 0f02bb6fb..2186498ef 100644 --- a/src/components/status_content/status_content.js +++ b/src/components/status_content/status_content.js @@ -1,6 +1,5 @@ import { mapState as mapPiniaState } from 'pinia' -import { defineAsyncComponent } from 'vue' -import { mapGetters, mapState } from 'vuex' +import { mapState } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' import Gallery from 'src/components/gallery/gallery.vue' diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js index fe0056305..95da91ba7 100644 --- a/src/components/status_popover/status_popover.js +++ b/src/components/status_popover/status_popover.js @@ -1,7 +1,6 @@ import { find } from 'lodash' import Popover from 'src/components/popover/popover.vue' -import Status from 'src/components/status/status.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' diff --git a/src/components/sticker_picker/sticker_picker.js b/src/components/sticker_picker/sticker_picker.js index 949d2ecf9..482aacb81 100644 --- a/src/components/sticker_picker/sticker_picker.js +++ b/src/components/sticker_picker/sticker_picker.js @@ -4,7 +4,6 @@ import statusPosterService from '../../services/status_poster/status_poster.serv import TabSwitcher from '../tab_switcher/tab_switcher.jsx' import { useEmojiStore } from 'src/stores/emoji.js' -import { useInstanceStore } from 'src/stores/instance.js' const StickerPicker = { components: { diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.jsx index b485b3ff8..a3c5b61cd 100644 --- a/src/components/tab_switcher/tab_switcher.jsx +++ b/src/components/tab_switcher/tab_switcher.jsx @@ -1,14 +1,11 @@ // eslint-disable-next-line no-unused -import { mapState } from 'pinia' -import { Fragment, h } from 'vue' +import { Fragment } from 'vue' import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome' import './tab_switcher.scss' -import { useInterfaceStore } from 'src/stores/interface.js' - const findFirstUsable = (slots) => slots.findIndex((_) => _.props) export default { diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 70fb057af..31a513130 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -22,7 +22,6 @@ import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.j import { useInterfaceStore } from 'src/stores/interface' import { useMediaViewerStore } from 'src/stores/media_viewer' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { useOAuthStore } from 'src/stores/oauth.js' import { usePostStatusStore } from 'src/stores/post_status' import { useUserHighlightStore } from 'src/stores/user_highlight.js' diff --git a/src/components/user_list_popover/user_list_popover.js b/src/components/user_list_popover/user_list_popover.js index 8a4612690..7f9ba4ffb 100644 --- a/src/components/user_list_popover/user_list_popover.js +++ b/src/components/user_list_popover/user_list_popover.js @@ -1,5 +1,3 @@ -import { defineAsyncComponent } from 'vue' - import Popover from 'src/components/popover/popover.vue' import UnicodeDomainIndicator from 'src/components/unicode_domain_indicator/unicode_domain_indicator.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js index de354d676..67c75be50 100644 --- a/src/components/user_popover/user_popover.js +++ b/src/components/user_popover/user_popover.js @@ -1,5 +1,4 @@ import { mapState } from 'pinia' -import { defineAsyncComponent } from 'vue' import Popover from 'src/components/popover/popover.vue' import UserCard from 'src/components/user_card/user_card.vue' diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index d2d766a7f..eb1d8e068 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -1,5 +1,4 @@ import { get } from 'lodash' -import { mapState } from 'pinia' import FollowCard from 'src/components/follow_card/follow_card.vue' import List from 'src/components/list/list.vue' @@ -7,7 +6,6 @@ import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx' import Timeline from 'src/components/timeline/timeline.vue' import UserCard from 'src/components/user_card/user_card.vue' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/user_profile/user_profile_admin_view.js b/src/components/user_profile/user_profile_admin_view.js index 94092b155..da2c6c322 100644 --- a/src/components/user_profile/user_profile_admin_view.js +++ b/src/components/user_profile/user_profile_admin_view.js @@ -1,6 +1,3 @@ -import { get } from 'lodash' -import { mapState } from 'pinia' - import Checkbox from 'src/components/checkbox/checkbox.vue' import List from 'src/components/list/list.vue' import Status from 'src/components/status/status.vue' diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js index 6f00b3e5e..28b63c973 100644 --- a/src/components/who_to_follow/who_to_follow.js +++ b/src/components/who_to_follow/who_to_follow.js @@ -1,6 +1,5 @@ import FollowCard from 'src/components/follow_card/follow_card.vue' -import { useInstanceStore } from 'src/stores/instance.js' import { useOAuthStore } from 'src/stores/oauth.js' import { fetchUser, suggestions } from 'src/api/public.js' diff --git a/src/lib/language.js b/src/lib/language.js index af53eeffd..dc5121452 100644 --- a/src/lib/language.js +++ b/src/lib/language.js @@ -1,5 +1,3 @@ -import Cookies from 'js-cookie' - import { useEmojiStore } from 'src/stores/emoji.js' import { useI18nStore } from 'src/stores/i18n.js' diff --git a/src/modules/api.js b/src/modules/api.js index ca1aacf05..72d7fb4d7 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -2,13 +2,12 @@ import { Socket } from 'phoenix' import { maybeShowChatNotification } from '../services/chat_utils/chat_utils.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useOAuthStore } from 'src/stores/oauth.js' import { useShoutStore } from 'src/stores/shout.js' -import { fetchTimeline } from 'src/api/public.js' +import { fetchTimeline } from 'src/api/timelines.js' import { getMastodonSocketURI, ProcessedWS, diff --git a/src/modules/default_config_state.js b/src/modules/default_config_state.js index 6a970ef0f..ec190af28 100644 --- a/src/modules/default_config_state.js +++ b/src/modules/default_config_state.js @@ -1,4 +1,4 @@ -import { get, set } from 'lodash' +import { get } from 'lodash' const browserLocale = (navigator.language || 'en').split('-')[0] diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index f787b92e4..8530c468c 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -1,11 +1,10 @@ import { promiseInterval } from '../promise_interval/promise_interval.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { fetchTimeline } from 'src/api/public.js' +import { fetchTimeline } from 'src/api/timelines.js' const update = ({ store, notifications, older }) => { store.dispatch('addNewNotifications', { notifications, older }) diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index ff75ea704..80dbc75d0 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -2,12 +2,11 @@ import { camelCase } from 'lodash' import { promiseInterval } from '../promise_interval/promise_interval.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { fetchTimeline } from 'src/api/public.js' +import { fetchTimeline } from 'src/api/timelines.js' const update = ({ store, diff --git a/src/stores/instance.js b/src/stores/instance.js index ea3419e80..02edd1235 100644 --- a/src/stores/instance.js +++ b/src/stores/instance.js @@ -1,4 +1,4 @@ -import { get, set } from 'lodash' +import { set } from 'lodash' import { defineStore } from 'pinia' import { diff --git a/src/stores/local_config.js b/src/stores/local_config.js index 5b15c6ff1..786da657b 100644 --- a/src/stores/local_config.js +++ b/src/stores/local_config.js @@ -1,8 +1,5 @@ import { cloneDeep, set } from 'lodash' import { defineStore } from 'pinia' -import { toRaw } from 'vue' - -import { useInstanceStore } from 'src/stores/instance' import { LOCAL_DEFAULT_CONFIG, diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index ccc4bbd4d..47c6978d5 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -20,7 +20,6 @@ import { toRaw } from 'vue' import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js' -import { useInstanceStore } from 'src/stores/instance.js' import { useLocalConfigStore } from 'src/stores/local_config.js' import { useOAuthStore } from 'src/stores/oauth.js' diff --git a/src/stores/user_highlight.js b/src/stores/user_highlight.js index b056ca808..759ebd509 100644 --- a/src/stores/user_highlight.js +++ b/src/stores/user_highlight.js @@ -1,15 +1,11 @@ import { merge as _merge, - clamp, clone, cloneDeep, - findLastIndex, flatten, - get, groupBy, isEqual, takeRight, - uniqWith, } from 'lodash' import { defineStore } from 'pinia' import { toRaw } from 'vue' @@ -33,17 +29,6 @@ export const defaultState = { cache: null, } -export const _moveItemInArray = (array, value, movement) => { - const oldIndex = array.indexOf(value) - const newIndex = oldIndex + movement - const newArray = [...array] - // remove old - newArray.splice(oldIndex, 1) - // add new - newArray.splice(clamp(newIndex, 0, newArray.length + 1), 0, value) - return newArray -} - const _wrapData = (data, userName) => { return { ...data, diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js index a9cb3fd27..afd17e56b 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -2,7 +2,6 @@ import mastoapidata from '../../../../fixtures/mastoapi.json' import { parseLinkHeaderPagination, - parseNotification, parseStatus, parseUser, } from 'src/services/entity_normalizer/entity_normalizer.service.js' diff --git a/test/unit/specs/stores/lists.spec.js b/test/unit/specs/stores/lists.spec.js index c71cce555..3720aa776 100644 --- a/test/unit/specs/stores/lists.spec.js +++ b/test/unit/specs/stores/lists.spec.js @@ -12,7 +12,7 @@ describe('The lists store', () => { let store beforeEach(() => { - createTestingPinia({ stubActions: false }) + setActivePinia(createTestingPinia({ stubActions: false })) store = useListsStore() }) diff --git a/test/unit/specs/stores/oauth.spec.js b/test/unit/specs/stores/oauth.spec.js index 828175c9f..6e61fea79 100644 --- a/test/unit/specs/stores/oauth.spec.js +++ b/test/unit/specs/stores/oauth.spec.js @@ -9,8 +9,6 @@ import { useOAuthStore } from 'src/stores/oauth.js' import { MASTODON_APP_URL, MASTODON_APP_VERIFY_URL, - OAUTH_MFA_CHALLENGE_URL, - OAUTH_REVOKE_URL, OAUTH_TOKEN_URL, } from 'src/api/oauth.js' diff --git a/test/unit/specs/stores/user_highlight.spec.js b/test/unit/specs/stores/user_highlight.spec.js index c46852256..f80143b6e 100644 --- a/test/unit/specs/stores/user_highlight.spec.js +++ b/test/unit/specs/stores/user_highlight.spec.js @@ -1,10 +1,8 @@ -import { cloneDeep } from 'lodash' import { createPinia, setActivePinia } from 'pinia' import { _getRecentData, _mergeHighlights, - _moveItemInArray, useUserHighlightStore, } from 'src/stores/user_highlight.js' diff --git a/vite.config.js b/vite.config.js index 64859ebb1..beff5fe76 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,5 @@ import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' -import { DevTools } from '@vitejs/devtools' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' import { playwright } from '@vitest/browser-playwright'