fix code quality issues
This commit is contained in:
		@@ -66,11 +66,9 @@ const XCode = defineAsyncComponent(() => import('@/components/MkCode.core.vue'))
 | 
			
		||||
.codePlaceholderRoot {
 | 
			
		||||
	display: block;
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	background: none;
 | 
			
		||||
	border: none;
 | 
			
		||||
	outline: none;
 | 
			
		||||
  font: inherit;
 | 
			
		||||
  color: inherit;
 | 
			
		||||
	font: inherit;
 | 
			
		||||
	cursor: pointer;
 | 
			
		||||
 | 
			
		||||
	box-sizing: border-box;
 | 
			
		||||
 
 | 
			
		||||
@@ -74,7 +74,7 @@ async function calcAspectRatio() {
 | 
			
		||||
			gallery.value.style.aspectRatio = ratioMax(16 / 9);
 | 
			
		||||
			break;
 | 
			
		||||
		case '1_1':
 | 
			
		||||
			gallery.value.style.aspectRatio = ratioMax(1 / 1);
 | 
			
		||||
			gallery.value.style.aspectRatio = ratioMax(1);
 | 
			
		||||
			break;
 | 
			
		||||
		case '2_3':
 | 
			
		||||
			gallery.value.style.aspectRatio = ratioMax(2 / 3);
 | 
			
		||||
 
 | 
			
		||||
@@ -100,7 +100,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue';
 | 
			
		||||
import { inject, watch, nextTick, onMounted, onUnmounted, defineAsyncComponent, provide, shallowRef, ref, computed } from 'vue';
 | 
			
		||||
import * as mfm from 'mfm-js';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import insertTextAtCursor from 'insert-text-at-cursor';
 | 
			
		||||
@@ -191,7 +191,9 @@ if (props.initialVisibleUsers) {
 | 
			
		||||
	props.initialVisibleUsers.forEach(pushVisibleUser);
 | 
			
		||||
}
 | 
			
		||||
const reactionAcceptance = ref(defaultStore.state.reactionAcceptance);
 | 
			
		||||
const autocomplete = ref(null);
 | 
			
		||||
const autocompleteTextareaInput = ref<Autocomplete | null>(null);
 | 
			
		||||
const autocompleteCwInput = ref<Autocomplete | null>(null);
 | 
			
		||||
const autocompleteHashtagsInput = ref<Autocomplete | null>(null);
 | 
			
		||||
const draghover = ref(false);
 | 
			
		||||
const quoteId = ref(null);
 | 
			
		||||
const hasNotSpecifiedMentions = ref(false);
 | 
			
		||||
@@ -909,10 +911,9 @@ onMounted(() => {
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// TODO: detach when unmount
 | 
			
		||||
	new Autocomplete(textareaEl.value, text);
 | 
			
		||||
	new Autocomplete(cwInputEl.value, cw);
 | 
			
		||||
	new Autocomplete(hashtagsInputEl.value, hashtags);
 | 
			
		||||
	autocompleteTextareaInput.value = new Autocomplete(textareaEl.value, text);
 | 
			
		||||
	autocompleteCwInput.value = new Autocomplete(cwInputEl.value, cw);
 | 
			
		||||
	autocompleteHashtagsInput.value = new Autocomplete(hashtagsInputEl.value, hashtags);
 | 
			
		||||
 | 
			
		||||
	nextTick(() => {
 | 
			
		||||
		// 書きかけの投稿を復元
 | 
			
		||||
@@ -955,6 +956,15 @@ onMounted(() => {
 | 
			
		||||
	});
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
onUnmounted(() => {
 | 
			
		||||
	autocompleteTextareaInput.value?.detach();
 | 
			
		||||
	autocompleteTextareaInput.value = null;
 | 
			
		||||
	autocompleteCwInput.value?.detach();
 | 
			
		||||
	autocompleteCwInput.value = null;
 | 
			
		||||
	autocompleteHashtagsInput.value?.detach();
 | 
			
		||||
	autocompleteHashtagsInput.value = null;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
defineExpose({
 | 
			
		||||
	clear,
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import { Ref } from 'vue';
 | 
			
		||||
 | 
			
		||||
export type MenuAction = (ev: MouseEvent) => void;
 | 
			
		||||
export type MenuAction = (ev: MouseEvent) => Promise<void> | void;
 | 
			
		||||
 | 
			
		||||
export type MenuDivider = { type: 'divider' };
 | 
			
		||||
export type MenuNull = undefined;
 | 
			
		||||
 
 | 
			
		||||
@@ -7,5 +7,5 @@ export type PageHeaderItem = {
 | 
			
		||||
    text: string;
 | 
			
		||||
    icon: string;
 | 
			
		||||
    highlighted?: boolean;
 | 
			
		||||
    handler: (ev: MouseEvent) => void;
 | 
			
		||||
    handler: (ev: MouseEvent) => Promise<void> | void;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user