From 40d5ad1b2d3f3c635574de25cf9898ca68196f2b Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 31 Oct 2023 20:19:05 +0900 Subject: [PATCH] chore: remove unused imports/variables --- packages/client/src/account.ts | 2 +- .../src/components/MkModalPageWindow.vue | 1 - .../client/src/components/MkNotePreview.vue | 2 +- .../client/src/components/MkNoteSimple.vue | 2 +- packages/client/src/components/MkNotes.vue | 2 +- .../client/src/components/MkObjectView.vue | 3 +-- .../src/components/MkPostFormAttaches.vue | 1 - .../client/src/components/MkReactionIcon.vue | 2 +- .../src/components/MkReactionTooltip.vue | 2 +- .../components/MkReactionsViewer.details.vue | 2 +- packages/client/src/components/MkSignin.vue | 4 ++-- .../client/src/components/MkSigninDialog.vue | 2 +- .../client/src/components/MkSignupDialog.vue | 2 +- packages/client/src/components/MkUserList.vue | 2 +- .../client/src/components/MkUsersTooltip.vue | 3 +-- .../src/components/MkVisibilityPicker.vue | 1 - packages/client/src/directives/focus.ts | 2 +- packages/client/src/directives/hotkey.ts | 2 +- packages/client/src/directives/ripple.ts | 3 ++- packages/client/src/directives/vibrate.ts | 2 +- packages/client/src/filters/note.ts | 4 +++- packages/client/src/filters/number.ts | 2 +- packages/client/src/init.ts | 2 +- packages/client/src/nirax.ts | 2 +- packages/client/src/pages/_empty_.vue | 2 -- packages/client/src/pages/_loading_.vue | 2 -- packages/client/src/pages/settings/drive.vue | 4 ++-- .../client/src/pages/user/index.activity.vue | 2 +- packages/client/src/router.ts | 19 +++++++++---------- packages/client/src/scripts/get-note-menu.ts | 2 +- .../client/src/scripts/get-note-summary.ts | 1 - packages/client/src/scripts/popup-position.ts | 2 -- .../client/src/scripts/use-leave-guard.ts | 6 +++--- packages/client/src/ui/_common_/common.vue | 2 +- .../src/ui/_common_/navbar-for-mobile.vue | 9 +-------- .../src/ui/_common_/statusbar-federation.vue | 4 +--- .../client/src/ui/_common_/statusbar-rss.vue | 3 +-- .../src/ui/_common_/statusbar-user-list.vue | 2 +- .../client/src/ui/_common_/statusbars.vue | 3 +-- packages/client/src/ui/_common_/sw-inject.ts | 2 -- packages/client/src/ui/deck/column-core.vue | 1 - packages/client/src/ui/deck/deck-store.ts | 1 - packages/client/src/ui/visitor.vue | 3 +-- packages/client/src/ui/visitor/a.vue | 2 +- packages/client/src/ui/visitor/kanban.vue | 2 +- packages/client/src/widgets/button.vue | 9 ++------- packages/client/src/widgets/calendar.vue | 8 ++------ packages/client/src/widgets/clock.vue | 6 +----- packages/client/src/widgets/digital-clock.vue | 2 +- .../client/src/widgets/instance-cloud.vue | 6 +----- packages/client/src/widgets/online-users.vue | 8 ++------ packages/client/src/widgets/post-form.vue | 7 +------ packages/client/src/widgets/server-info.vue | 13 ++----------- packages/client/src/widgets/slideshow.vue | 8 ++------ packages/client/src/widgets/unix-clock.vue | 6 +----- 55 files changed, 65 insertions(+), 134 deletions(-) diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index f1185e4df3..c91259d127 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -1,4 +1,4 @@ -import { defineAsyncComponent, reactive } from "vue"; +import { defineAsyncComponent } from "vue"; import type * as firefish from "firefish-js"; import { i18n } from "./i18n"; import { del, get, set } from "@/scripts/idb-proxy"; diff --git a/packages/client/src/components/MkModalPageWindow.vue b/packages/client/src/components/MkModalPageWindow.vue index bcf763e3a1..bd44379001 100644 --- a/packages/client/src/components/MkModalPageWindow.vue +++ b/packages/client/src/components/MkModalPageWindow.vue @@ -64,7 +64,6 @@ import { i18n } from "@/i18n"; import type { PageMetadata } from "@/scripts/page-metadata"; import { provideMetadataReceiver } from "@/scripts/page-metadata"; import { Router } from "@/nirax"; -import { defaultStore } from "@/store"; import icon from "@/scripts/icon"; const props = defineProps<{ diff --git a/packages/client/src/components/MkNotePreview.vue b/packages/client/src/components/MkNotePreview.vue index be007738d9..62bcc0f0c5 100644 --- a/packages/client/src/components/MkNotePreview.vue +++ b/packages/client/src/components/MkNotePreview.vue @@ -22,7 +22,7 @@ diff --git a/packages/client/src/components/MkNoteSimple.vue b/packages/client/src/components/MkNoteSimple.vue index 5f45811fc1..70ee62bf28 100644 --- a/packages/client/src/components/MkNoteSimple.vue +++ b/packages/client/src/components/MkNoteSimple.vue @@ -15,7 +15,7 @@ import type * as firefish from "firefish-js"; import XNoteHeader from "@/components/MkNoteHeader.vue"; import MkSubNoteContent from "@/components/MkSubNoteContent.vue"; -const props = defineProps<{ +defineProps<{ note: firefish.entities.Note; pinned?: boolean; }>(); diff --git a/packages/client/src/components/MkNotes.vue b/packages/client/src/components/MkNotes.vue index 267ce7463b..f64100a6fd 100644 --- a/packages/client/src/components/MkNotes.vue +++ b/packages/client/src/components/MkNotes.vue @@ -45,7 +45,7 @@ import { scroll } from "@/scripts/scroll"; const tlEl = ref(); -const props = defineProps<{ +defineProps<{ pagination: Paging; noGap?: boolean; }>(); diff --git a/packages/client/src/components/MkObjectView.vue b/packages/client/src/components/MkObjectView.vue index 74f3ed0a31..1e69ba988d 100644 --- a/packages/client/src/components/MkObjectView.vue +++ b/packages/client/src/components/MkObjectView.vue @@ -5,10 +5,9 @@ diff --git a/packages/client/src/components/MkPostFormAttaches.vue b/packages/client/src/components/MkPostFormAttaches.vue index 8e6e41a279..a879bd5d8b 100644 --- a/packages/client/src/components/MkPostFormAttaches.vue +++ b/packages/client/src/components/MkPostFormAttaches.vue @@ -35,7 +35,6 @@ import { VueDraggable } from "vue-draggable-plus"; import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue"; import * as os from "@/os"; import { i18n } from "@/i18n"; -import { defaultStore } from "@/store"; import icon from "@/scripts/icon"; const props = defineProps({ diff --git a/packages/client/src/components/MkReactionIcon.vue b/packages/client/src/components/MkReactionIcon.vue index 89e056bab2..e9d5a198cc 100644 --- a/packages/client/src/components/MkReactionIcon.vue +++ b/packages/client/src/components/MkReactionIcon.vue @@ -9,7 +9,7 @@ diff --git a/packages/client/src/pages/_loading_.vue b/packages/client/src/pages/_loading_.vue index 832c05916c..93bb8bb2fb 100644 --- a/packages/client/src/pages/_loading_.vue +++ b/packages/client/src/pages/_loading_.vue @@ -1,5 +1,3 @@ - - diff --git a/packages/client/src/pages/settings/drive.vue b/packages/client/src/pages/settings/drive.vue index bd8b46600a..a0b88e1728 100644 --- a/packages/client/src/pages/settings/drive.vue +++ b/packages/client/src/pages/settings/drive.vue @@ -92,8 +92,8 @@ const fetching = ref(true); const usage = ref(null); const capacity = ref(null); const uploadFolder = ref(null); -const alwaysMarkNsfw = ref($i.alwaysMarkNsfw); -const autoSensitive = ref($i.autoSensitive); +const alwaysMarkNsfw = ref($i != null && $i.alwaysMarkNsfw); +const autoSensitive = ref($i != null && $i.autoSensitive); const meterStyle = computed(() => { return { diff --git a/packages/client/src/pages/user/index.activity.vue b/packages/client/src/pages/user/index.activity.vue index bfaf012a7e..e417f93bf4 100644 --- a/packages/client/src/pages/user/index.activity.vue +++ b/packages/client/src/pages/user/index.activity.vue @@ -35,7 +35,7 @@ import * as os from "@/os"; import { i18n } from "@/i18n"; import icon from "@/scripts/icon"; -const props = withDefaults( +withDefaults( defineProps<{ user: firefish.entities.User; limit?: number; diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index ea772bad5c..b2d74d6148 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -5,18 +5,17 @@ import { iAmModerator } from "@/account"; import { $i } from "@/reactiveAccount"; import MkLoading from "@/pages/_loading_.vue"; import MkError from "@/pages/_error_.vue"; -import { api } from "@/os"; -import { ui } from "@/config"; +// import { api } from "@/os"; -function getGuestTimelineStatus() { - api("meta", { - detail: false, - }).then((meta) => { - return meta.enableGuestTimeline; - }); -} +// function getGuestTimelineStatus() { +// api("meta", { +// detail: false, +// }).then((meta) => { +// return meta.enableGuestTimeline; +// }); +// } -const guestTimeline = getGuestTimelineStatus(); +// const guestTimeline = getGuestTimelineStatus(); const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts index 5bbb69a461..2e6b84bde0 100644 --- a/packages/client/src/scripts/get-note-menu.ts +++ b/packages/client/src/scripts/get-note-menu.ts @@ -1,5 +1,5 @@ import type { Ref } from "vue"; -import { defineAsyncComponent, inject } from "vue"; +import { defineAsyncComponent } from "vue"; import type * as firefish from "firefish-js"; import { $i } from "@/reactiveAccount"; import { i18n } from "@/i18n"; diff --git a/packages/client/src/scripts/get-note-summary.ts b/packages/client/src/scripts/get-note-summary.ts index a2ea4b4e2e..7a09c601ae 100644 --- a/packages/client/src/scripts/get-note-summary.ts +++ b/packages/client/src/scripts/get-note-summary.ts @@ -1,5 +1,4 @@ import type * as firefish from "firefish-js"; -import { i18n } from "@/i18n"; /** * 投稿を表す文字列を取得します。 diff --git a/packages/client/src/scripts/popup-position.ts b/packages/client/src/scripts/popup-position.ts index abc6cfb66f..45bcd4dbf5 100644 --- a/packages/client/src/scripts/popup-position.ts +++ b/packages/client/src/scripts/popup-position.ts @@ -1,5 +1,3 @@ -import { Ref } from "vue"; - export function calcPopupPosition( el: HTMLElement, props: { diff --git a/packages/client/src/scripts/use-leave-guard.ts b/packages/client/src/scripts/use-leave-guard.ts index 12c25651c9..07e22556df 100644 --- a/packages/client/src/scripts/use-leave-guard.ts +++ b/packages/client/src/scripts/use-leave-guard.ts @@ -1,7 +1,7 @@ import type { Ref } from "vue"; -import { inject, onUnmounted } from "vue"; -import { i18n } from "@/i18n"; -import * as os from "@/os"; +// import { inject, onUnmounted } from "vue"; +// import { i18n } from "@/i18n"; +// import * as os from "@/os"; export function useLeaveGuard(enabled: Ref) { /* TODO diff --git a/packages/client/src/ui/_common_/common.vue b/packages/client/src/ui/_common_/common.vue index d808f303c4..dc20b6905c 100644 --- a/packages/client/src/ui/_common_/common.vue +++ b/packages/client/src/ui/_common_/common.vue @@ -19,7 +19,7 @@