fix share page

This commit is contained in:
tamaina 2023-02-10 11:52:13 +00:00
parent 3c504b4b08
commit 9cc36ef32d
2 changed files with 9 additions and 9 deletions

View File

@ -109,7 +109,7 @@ const props = withDefaults(defineProps<{
mention?: misskey.entities.User; mention?: misskey.entities.User;
specified?: misskey.entities.User; specified?: misskey.entities.User;
initialText?: string; initialText?: string;
initialVisibility?: typeof misskey.noteVisibilities; initialVisibility?: (typeof misskey.noteVisibilities)[number];
initialFiles?: misskey.entities.DriveFile[]; initialFiles?: misskey.entities.DriveFile[];
initialLocalOnly?: boolean; initialLocalOnly?: boolean;
initialVisibleUsers?: misskey.entities.User[]; initialVisibleUsers?: misskey.entities.User[];

View File

@ -2,7 +2,7 @@
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<XPostForm <MkPostForm
v-if="state === 'writing'" v-if="state === 'writing'"
fixed fixed
:instant="true" :instant="true"
@ -37,17 +37,17 @@ import { i18n } from '@/i18n';
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const localOnlyQuery = urlParams.get('localOnly'); const localOnlyQuery = urlParams.get('localOnly');
const visibilityQuery = urlParams.get('visibility'); const visibilityQuery = urlParams.get('visibility') as typeof noteVisibilities[number];
let state = $ref('fetching' as 'fetching' | 'writing' | 'posted'); let state = $ref('fetching' as 'fetching' | 'writing' | 'posted');
let title = $ref(urlParams.get('title')); let title = $ref(urlParams.get('title'));
const text = urlParams.get('text'); const text = urlParams.get('text');
const url = urlParams.get('url'); const url = urlParams.get('url');
let initialText = $ref(null as string | null); let initialText = $ref<string | undefined>();
let reply = $ref(null as Misskey.entities.Note | null); let reply = $ref<Misskey.entities.Note | undefined>();
let renote = $ref(null as Misskey.entities.Note | null); let renote = $ref<Misskey.entities.Note | undefined>();
let visibility = $ref(noteVisibilities.includes(visibilityQuery) ? visibilityQuery : null); let visibility = $ref(noteVisibilities.includes(visibilityQuery) ? visibilityQuery : undefined);
let localOnly = $ref(localOnlyQuery === '0' ? false : localOnlyQuery === '1' ? true : null); let localOnly = $ref(localOnlyQuery === '0' ? false : localOnlyQuery === '1' ? true : undefined);
let files = $ref([] as Misskey.entities.DriveFile[]); let files = $ref([] as Misskey.entities.DriveFile[]);
let visibleUsers = $ref([] as Misskey.entities.User[]); let visibleUsers = $ref([] as Misskey.entities.User[]);
@ -130,7 +130,7 @@ async function init() {
); );
} }
//#endregion //#endregion
} catch (err) { } catch (err: any) {
os.alert({ os.alert({
type: 'error', type: 'error',
title: err.message, title: err.message,