refactor(frontend): 非推奨となったReactivity Transformを使わないように (#12539)
* refactor(frontend): 非推奨となったReactivity Transformを使わないように * refactor: 不要な括弧を除去 * fix: 不要なアノテーションを除去 * fix: Refの配列をrefしている部分の対応 * refactor: 不要な括弧を除去 * fix: lint * refactor: Ref、ShallowRef、ComputedRefの変数の宣言をletからconstに置換 * fix: type error * chore: drop reactivity transform from eslint configuration * refactor: remove unnecessary import * fix: 対応漏れ
This commit is contained in:
		@@ -49,7 +49,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { watch } from 'vue';
 | 
			
		||||
import { watch, ref } from 'vue';
 | 
			
		||||
import * as Misskey from 'misskey-js';
 | 
			
		||||
import MkButton from '@/components/MkButton.vue';
 | 
			
		||||
import MkInput from '@/components/MkInput.vue';
 | 
			
		||||
@@ -69,38 +69,38 @@ const emit = defineEmits<{
 | 
			
		||||
	(ev: 'deleted'): void,
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
let name: string = $ref(props.antenna.name);
 | 
			
		||||
let src: string = $ref(props.antenna.src);
 | 
			
		||||
let userListId: any = $ref(props.antenna.userListId);
 | 
			
		||||
let users: string = $ref(props.antenna.users.join('\n'));
 | 
			
		||||
let keywords: string = $ref(props.antenna.keywords.map(x => x.join(' ')).join('\n'));
 | 
			
		||||
let excludeKeywords: string = $ref(props.antenna.excludeKeywords.map(x => x.join(' ')).join('\n'));
 | 
			
		||||
let caseSensitive: boolean = $ref(props.antenna.caseSensitive);
 | 
			
		||||
let localOnly: boolean = $ref(props.antenna.localOnly);
 | 
			
		||||
let withReplies: boolean = $ref(props.antenna.withReplies);
 | 
			
		||||
let withFile: boolean = $ref(props.antenna.withFile);
 | 
			
		||||
let notify: boolean = $ref(props.antenna.notify);
 | 
			
		||||
let userLists: any = $ref(null);
 | 
			
		||||
const name = ref<string>(props.antenna.name);
 | 
			
		||||
const src = ref<string>(props.antenna.src);
 | 
			
		||||
const userListId = ref<any>(props.antenna.userListId);
 | 
			
		||||
const users = ref<string>(props.antenna.users.join('\n'));
 | 
			
		||||
const keywords = ref<string>(props.antenna.keywords.map(x => x.join(' ')).join('\n'));
 | 
			
		||||
const excludeKeywords = ref<string>(props.antenna.excludeKeywords.map(x => x.join(' ')).join('\n'));
 | 
			
		||||
const caseSensitive = ref<boolean>(props.antenna.caseSensitive);
 | 
			
		||||
const localOnly = ref<boolean>(props.antenna.localOnly);
 | 
			
		||||
const withReplies = ref<boolean>(props.antenna.withReplies);
 | 
			
		||||
const withFile = ref<boolean>(props.antenna.withFile);
 | 
			
		||||
const notify = ref<boolean>(props.antenna.notify);
 | 
			
		||||
const userLists = ref<any>(null);
 | 
			
		||||
 | 
			
		||||
watch(() => src, async () => {
 | 
			
		||||
	if (src === 'list' && userLists === null) {
 | 
			
		||||
		userLists = await os.api('users/lists/list');
 | 
			
		||||
watch(() => src.value, async () => {
 | 
			
		||||
	if (src.value === 'list' && userLists.value === null) {
 | 
			
		||||
		userLists.value = await os.api('users/lists/list');
 | 
			
		||||
	}
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
async function saveAntenna() {
 | 
			
		||||
	const antennaData = {
 | 
			
		||||
		name,
 | 
			
		||||
		src,
 | 
			
		||||
		userListId,
 | 
			
		||||
		withReplies,
 | 
			
		||||
		withFile,
 | 
			
		||||
		notify,
 | 
			
		||||
		caseSensitive,
 | 
			
		||||
		localOnly,
 | 
			
		||||
		users: users.trim().split('\n').map(x => x.trim()),
 | 
			
		||||
		keywords: keywords.trim().split('\n').map(x => x.trim().split(' ')),
 | 
			
		||||
		excludeKeywords: excludeKeywords.trim().split('\n').map(x => x.trim().split(' ')),
 | 
			
		||||
		name: name.value,
 | 
			
		||||
		src: src.value,
 | 
			
		||||
		userListId: userListId.value,
 | 
			
		||||
		withReplies: withReplies.value,
 | 
			
		||||
		withFile: withFile.value,
 | 
			
		||||
		notify: notify.value,
 | 
			
		||||
		caseSensitive: caseSensitive.value,
 | 
			
		||||
		localOnly: localOnly.value,
 | 
			
		||||
		users: users.value.trim().split('\n').map(x => x.trim()),
 | 
			
		||||
		keywords: keywords.value.trim().split('\n').map(x => x.trim().split(' ')),
 | 
			
		||||
		excludeKeywords: excludeKeywords.value.trim().split('\n').map(x => x.trim().split(' ')),
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	if (props.antenna.id == null) {
 | 
			
		||||
@@ -130,9 +130,9 @@ async function deleteAntenna() {
 | 
			
		||||
 | 
			
		||||
function addUser() {
 | 
			
		||||
	os.selectUser().then(user => {
 | 
			
		||||
		users = users.trim();
 | 
			
		||||
		users += '\n@' + Misskey.acct.toString(user as any);
 | 
			
		||||
		users = users.trim();
 | 
			
		||||
		users.value = users.value.trim();
 | 
			
		||||
		users.value += '\n@' + Misskey.acct.toString(user as any);
 | 
			
		||||
		users.value = users.value.trim();
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user