@@ -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 >
< 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" >
< 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" >
< 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 >
< div : class = "[$style.textOuter, { [$style.withCw]: useCw }]" >
< div : class = "[$style.textOuter, { [$style.withCw]: useCw }]" >
< div v-if = "channel" :class="$style.colorBar" :style="{ background: channel.color }" > < / div >
< 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 >
< script lang = "ts" setup >
import { inject , watch , nextTick , onMounted , defineAsyncComponent , provide , shallowRef , ref , computed } from 'vue' ;
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 mfm from 'mfm-js' ;
import * as Misskey from 'misskey-js' ;
import * as Misskey from 'misskey-js' ;
import insertTextAtCursor from 'insert-text-at-cursor' ;
import insertTextAtCursor from 'insert-text-at-cursor' ;
import { toASCII } from 'punycode.js' ;
import { toASCII } from 'punycode.js' ;
import { host , url } from '@@/js/config.js' ;
import { host , url } from '@@/js/config.js' ;
import type { ShallowRef } from 'vue' ;
import type { PostFormProps } from '@/types/post-form.js' ;
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 MkNotePreview from '@/components/MkNotePreview.vue' ;
import XPostFormAttaches from '@/components/MkPostFormAttaches.vue' ;
import XPostFormAttaches from '@/components/MkPostFormAttaches.vue' ;
import MkPollEditor from '@/components/MkPollEditor.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 { erase , unique } from '@/scripts/array.js' ;
import { extractMentions } from '@/scripts/extract-mentions.js' ;
import { extractMentions } from '@/scripts/extract-mentions.js' ;
import { formatTimeString } from '@/scripts/format-time-string.js' ;
import { formatTimeString } from '@/scripts/format-time-string.js' ;
@@ -150,7 +150,6 @@ const props = withDefaults(defineProps<PostFormProps & {
autofocus : true ,
autofocus : true ,
mock : false ,
mock : false ,
initialLocalOnly : undefined ,
initialLocalOnly : undefined ,
deleteInitialNoteAfterPost : false ,
} ) ;
} ) ;
provide ( 'mock' , props . mock ) ;
provide ( 'mock' , props . mock ) ;
@@ -846,12 +845,6 @@ async function post(ev?: MouseEvent) {
clear ( ) ;
clear ( ) ;
}
}
nextTick ( ( ) => {
nextTick ( ( ) => {
/ / 削 除 し て 編 集 の 対 象 ノ ー ト を 削 除
if ( props . initialNote && props . deleteInitialNoteAfterPost ) {
misskeyApi ( 'notes/delete' , {
noteId : props . initialNote . id ,
} ) ;
}
deleteDraft ( ) ;
deleteDraft ( ) ;
emit ( 'posted' ) ;
emit ( 'posted' ) ;
if ( postData . text && postData . text !== '' ) {
if ( postData . text && postData . text !== '' ) {
@@ -903,11 +896,6 @@ async function post(ev?: MouseEvent) {
if ( m === 0 && s === 0 ) {
if ( m === 0 && s === 0 ) {
claimAchievement ( 'postedAt0min0sec' ) ;
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 => {
} ) . catch ( err => {
posting . value = false ;
posting . value = false ;