summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-06 16:28:25 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-06 16:28:25 +0900
commit896bde100508c9122c6915567fe398dfb1914c94 (patch)
treeb0749661a61a2ff004f142b120cfbfae170246a4 /packages
parentfix(frontend): tabler-iconsが読み込めない問題を修正(正式リ... (diff)
downloadmisskey-896bde100508c9122c6915567fe398dfb1914c94.tar.gz
misskey-896bde100508c9122c6915567fe398dfb1914c94.tar.bz2
misskey-896bde100508c9122c6915567fe398dfb1914c94.zip
revert https://github.com/misskey-dev/misskey/pull/15545
see https://github.com/misskey-dev/misskey/issues/14498
Diffstat (limited to 'packages')
-rw-r--r--packages/frontend/src/components/MkPostForm.vue20
-rw-r--r--packages/frontend/src/scripts/get-note-menu.ts12
-rw-r--r--packages/frontend/src/types/post-form.ts1
3 files changed, 14 insertions, 19 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index 255aa6ca19..b39a4ad708 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkInfo v-if="hasNotSpecifiedMentions" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo>
<div v-show="useCw" :class="$style.cwOuter">
<input ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown" @keyup="onKeyup" @compositionend="onCompositionEnd">
- <div v-if="maxCwTextLength - cwTextLength < 20" :class="['_acrylic', $style.cwTextCount, { [$style.cwTextOver]: cwTextLength > maxCwTextLength }]">{{ maxCwTextLength - cwTextLength }}</div>
+ <div v-if="maxCwTextLength - cwTextLength < 20" :class="['_acrylic', $style.cwTextCount, { [$style.cwTextOver]: cwTextLength > maxCwTextLength }]">{{ maxCwTextLength - cwTextLength }}</div>
</div>
<div :class="[$style.textOuter, { [$style.withCw]: useCw }]">
<div v-if="channel" :class="$style.colorBar" :style="{ background: channel.color }"></div>
@@ -104,18 +104,18 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue';
+import type { ShallowRef } from 'vue';
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import insertTextAtCursor from 'insert-text-at-cursor';
import { toASCII } from 'punycode.js';
import { host, url } from '@@/js/config.js';
-import type { ShallowRef } from 'vue';
import type { PostFormProps } from '@/types/post-form.js';
-import type { PollEditorModelValue } from '@/components/MkPollEditor.vue';
+import MkNoteSimple from '@/components/MkNoteSimple.vue';
import MkNotePreview from '@/components/MkNotePreview.vue';
import XPostFormAttaches from '@/components/MkPostFormAttaches.vue';
import MkPollEditor from '@/components/MkPollEditor.vue';
-import MkNoteSimple from '@/components/MkNoteSimple.vue';
+import type { PollEditorModelValue } from '@/components/MkPollEditor.vue';
import { erase, unique } from '@/scripts/array.js';
import { extractMentions } from '@/scripts/extract-mentions.js';
import { formatTimeString } from '@/scripts/format-time-string.js';
@@ -150,7 +150,6 @@ const props = withDefaults(defineProps<PostFormProps & {
autofocus: true,
mock: false,
initialLocalOnly: undefined,
- deleteInitialNoteAfterPost: false,
});
provide('mock', props.mock);
@@ -846,12 +845,6 @@ async function post(ev?: MouseEvent) {
clear();
}
nextTick(() => {
- // 削除して編集の対象ノートを削除
- if (props.initialNote && props.deleteInitialNoteAfterPost) {
- misskeyApi('notes/delete', {
- noteId: props.initialNote.id,
- });
- }
deleteDraft();
emit('posted');
if (postData.text && postData.text !== '') {
@@ -903,11 +896,6 @@ async function post(ev?: MouseEvent) {
if (m === 0 && s === 0) {
claimAchievement('postedAt0min0sec');
}
- if (props.initialNote && props.deleteInitialNoteAfterPost) {
- if (date.getTime() - new Date(props.initialNote.createdAt).getTime() < 1000 * 60 && props.initialNote.userId === $i.id) {
- claimAchievement('noteDeletedWithin1min');
- }
- }
});
}).catch(err => {
posting.value = false;
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts
index de7ed15675..84122c0e60 100644
--- a/packages/frontend/src/scripts/get-note-menu.ts
+++ b/packages/frontend/src/scripts/get-note-menu.ts
@@ -4,10 +4,10 @@
*/
import { defineAsyncComponent } from 'vue';
+import type { Ref, ShallowRef } from 'vue';
import * as Misskey from 'misskey-js';
import { url } from '@@/js/config.js';
import { claimAchievement } from './achievements.js';
-import type { Ref, ShallowRef } from 'vue';
import type { MenuItem } from '@/types/menu.js';
import { $i } from '@/account.js';
import { i18n } from '@/i18n.js';
@@ -208,7 +208,15 @@ export function getNoteMenu(props: {
}).then(({ canceled }) => {
if (canceled) return;
- os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel, deleteInitialNoteAfterPost: true });
+ misskeyApi('notes/delete', {
+ noteId: appearNote.id,
+ });
+
+ os.post({ initialNote: appearNote, renote: appearNote.renote, reply: appearNote.reply, channel: appearNote.channel });
+
+ if (Date.now() - new Date(appearNote.createdAt).getTime() < 1000 * 60 && appearNote.userId === $i.id) {
+ claimAchievement('noteDeletedWithin1min');
+ }
});
}
diff --git a/packages/frontend/src/types/post-form.ts b/packages/frontend/src/types/post-form.ts
index 6e81c70074..5bb04a95a0 100644
--- a/packages/frontend/src/types/post-form.ts
+++ b/packages/frontend/src/types/post-form.ts
@@ -19,5 +19,4 @@ export interface PostFormProps {
initialVisibleUsers?: Misskey.entities.UserDetailed[];
initialNote?: Misskey.entities.Note;
instant?: boolean;
- deleteInitialNoteAfterPost?: boolean;
};