From 6ee1049731fc65403bf6ff60d5624373fadbb0b2 Mon Sep 17 00:00:00 2001 From: Lhcfl Date: Wed, 10 Apr 2024 01:18:08 +0800 Subject: [PATCH] use client-only noteVisibilities type --- packages/client/src/components/MkPostForm.vue | 5 +++-- packages/client/src/components/MkPostFormDialog.vue | 5 +++-- packages/client/src/components/MkVisibilityPicker.vue | 8 ++++---- packages/client/src/pages/share.vue | 8 +++++--- packages/client/src/store.ts | 6 +++--- packages/client/src/types/client-types.ts | 3 +++ packages/client/src/types/consts.ts | 6 ++++++ packages/firefish-js/src/consts.ts | 1 - 8 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 packages/client/src/types/client-types.ts create mode 100644 packages/client/src/types/consts.ts diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 8e4af77cf1..11cc812689 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -304,7 +304,7 @@ import insertTextAtCursor from "insert-text-at-cursor"; import { length } from "stringz"; import { toASCII } from "punycode/"; import { acct } from "firefish-js"; -import type { entities, languages, noteVisibilities } from "firefish-js"; +import type { entities, languages } from "firefish-js"; import { throttle } from "throttle-debounce"; import XNoteSimple from "@/components/MkNoteSimple.vue"; import XNotePreview from "@/components/MkNotePreview.vue"; @@ -340,6 +340,7 @@ import { import type { MenuItem } from "@/types/menu"; import icon from "@/scripts/icon"; import MkVisibilityPicker from "@/components/MkVisibilityPicker.vue"; +import type { NoteVisibility } from "@/types/client-types"; const modal = inject("modal"); @@ -351,7 +352,7 @@ const props = withDefaults( mention?: entities.User; specified?: entities.User; initialText?: string; - initialVisibility?: (typeof noteVisibilities)[number]; + initialVisibility?: NoteVisibility; initialLanguage?: typeof languages; initialFiles?: entities.DriveFile[]; initialLocalOnly?: boolean; diff --git a/packages/client/src/components/MkPostFormDialog.vue b/packages/client/src/components/MkPostFormDialog.vue index ed44296fd3..1f7eca0ba7 100644 --- a/packages/client/src/components/MkPostFormDialog.vue +++ b/packages/client/src/components/MkPostFormDialog.vue @@ -21,9 +21,10 @@