From c823cbe63b30d622d240adb92b696d0f507d084d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 1 Apr 2023 13:42:40 +0900 Subject: [PATCH] refactor(frontend): remove $store --- packages/frontend/@types/vue.d.ts | 1 - .../frontend/src/components/MkContainer.vue | 10 +++--- .../frontend/src/components/MkContextMenu.vue | 9 +++--- .../src/components/MkFoldableSection.vue | 4 ++- packages/frontend/src/components/MkFolder.vue | 9 +++--- .../frontend/src/components/MkMention.vue | 3 +- .../frontend/src/components/MkPagination.vue | 8 ++--- .../src/components/MkReactionsViewer.vue | 21 ++++++------ .../frontend/src/components/MkTimeline.vue | 3 +- packages/frontend/src/components/MkToast.vue | 9 +++--- .../frontend/src/components/MkTooltip.vue | 9 +++--- .../frontend/src/components/MkUrlPreview.vue | 3 +- .../src/components/MkUrlPreviewPopup.vue | 3 +- .../frontend/src/components/MkUserPopup.vue | 9 +++--- packages/frontend/src/components/MkWindow.vue | 9 +++--- .../src/components/MkYoutubePlayer.vue | 3 +- .../frontend/src/components/form/suspense.vue | 4 ++- .../frontend/src/components/global/MkAcct.vue | 3 +- .../src/components/global/MkError.vue | 3 +- .../src/components/page/page.post.vue | 5 +-- packages/frontend/src/init.ts | 3 +- packages/frontend/src/pages/_error_.vue | 3 +- .../src/pages/admin/overview.instances.vue | 3 +- .../src/pages/admin/overview.moderators.vue | 3 +- .../src/pages/admin/overview.stats.vue | 3 +- .../src/pages/admin/overview.users.vue | 3 +- packages/frontend/src/pages/flash/flash.vue | 5 +-- packages/frontend/src/pages/gallery/post.vue | 3 +- packages/frontend/src/pages/note.vue | 3 +- packages/frontend/src/pages/page.vue | 4 +-- packages/frontend/src/pages/timeline.vue | 4 +-- packages/frontend/src/ui/_common_/common.vue | 11 ++++--- .../src/ui/_common_/stream-indicator.vue | 3 +- packages/frontend/src/ui/classic.header.vue | 6 ++-- packages/frontend/src/ui/classic.sidebar.vue | 8 +++-- packages/frontend/src/ui/classic.vue | 6 ++-- packages/frontend/src/ui/deck.vue | 17 +++++----- packages/frontend/src/ui/universal.vue | 32 +++++++++---------- packages/frontend/src/ui/visitor/a.vue | 5 +-- packages/frontend/src/ui/visitor/b.vue | 4 +-- .../frontend/src/widgets/WidgetFederation.vue | 3 +- .../frontend/src/widgets/WidgetTrends.vue | 3 +- 42 files changed, 150 insertions(+), 113 deletions(-) diff --git a/packages/frontend/@types/vue.d.ts b/packages/frontend/@types/vue.d.ts index 9c9c34ccc5..661f455705 100644 --- a/packages/frontend/@types/vue.d.ts +++ b/packages/frontend/@types/vue.d.ts @@ -8,7 +8,6 @@ import type { i18n } from '@/i18n'; declare module 'vue' { interface ComponentCustomProperties { $i: typeof $i; - $store: typeof defaultStore; $instance: typeof instance; $t: typeof i18n['t']; $ts: typeof i18n['ts']; diff --git a/packages/frontend/src/components/MkContainer.vue b/packages/frontend/src/components/MkContainer.vue index 833fa9d382..e021cfbda9 100644 --- a/packages/frontend/src/components/MkContainer.vue +++ b/packages/frontend/src/components/MkContainer.vue @@ -14,10 +14,10 @@ import { defineComponent } from 'vue'; +import { defaultStore } from '@/store'; export default defineComponent({ props: { @@ -79,6 +80,7 @@ export default defineComponent({ showBody: this.expanded, omitted: null, ignoreOmit: false, + defaultStore, }; }, mounted() { diff --git a/packages/frontend/src/components/MkContextMenu.vue b/packages/frontend/src/components/MkContextMenu.vue index 21cccaabde..5bdf477241 100644 --- a/packages/frontend/src/components/MkContextMenu.vue +++ b/packages/frontend/src/components/MkContextMenu.vue @@ -1,10 +1,10 @@ @@ -14,6 +14,7 @@ import { } from 'vue'; import tinycolor from 'tinycolor2'; import { host as localHost } from '@/config'; import { $i } from '@/account'; +import { defaultStore } from '@/store'; const props = defineProps<{ username: string; diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index a1a61a6fd6..867d432572 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -1,9 +1,9 @@