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:
parent
e42c91dee7
commit
406b4bdbe7
277 changed files with 3353 additions and 3441 deletions
|
|
@ -63,7 +63,7 @@ const XUpload = defineAsyncComponent(() => import('./upload.vue'));
|
|||
|
||||
const dev = _DEV_;
|
||||
|
||||
let notifications = $ref<Misskey.entities.Notification[]>([]);
|
||||
const notifications = ref<Misskey.entities.Notification[]>([]);
|
||||
|
||||
function onNotification(notification: Misskey.entities.Notification, isClient = false) {
|
||||
if (document.visibilityState === 'visible') {
|
||||
|
|
@ -72,13 +72,13 @@ function onNotification(notification: Misskey.entities.Notification, isClient =
|
|||
useStream().send('readNotification');
|
||||
}
|
||||
|
||||
notifications.unshift(notification);
|
||||
notifications.value.unshift(notification);
|
||||
window.setTimeout(() => {
|
||||
if (notifications.length > 3) notifications.pop();
|
||||
if (notifications.value.length > 3) notifications.value.pop();
|
||||
}, 500);
|
||||
|
||||
window.setTimeout(() => {
|
||||
notifications = notifications.filter(x => x.id !== notification.id);
|
||||
notifications.value = notifications.value.filter(x => x.id !== notification.id);
|
||||
}, 6000);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const props = defineProps<{
|
|||
|
||||
const instances = ref<Misskey.entities.FederationInstance[]>([]);
|
||||
const fetching = ref(true);
|
||||
let key = $ref(0);
|
||||
const key = ref(0);
|
||||
|
||||
const tick = () => {
|
||||
os.api('federation/instances', {
|
||||
|
|
@ -58,7 +58,7 @@ const tick = () => {
|
|||
}).then(res => {
|
||||
instances.value = res;
|
||||
fetching.value = false;
|
||||
key++;
|
||||
key.value++;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const props = defineProps<{
|
|||
|
||||
const items = ref([]);
|
||||
const fetching = ref(true);
|
||||
let key = $ref(0);
|
||||
const key = ref(0);
|
||||
|
||||
const tick = () => {
|
||||
window.fetch(`/api/fetch-rss?url=${props.url}`, {}).then(res => {
|
||||
|
|
@ -54,7 +54,7 @@ const tick = () => {
|
|||
}
|
||||
items.value = feed.items;
|
||||
fetching.value = false;
|
||||
key++;
|
||||
key.value++;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ const props = defineProps<{
|
|||
|
||||
const notes = ref<Misskey.entities.Note[]>([]);
|
||||
const fetching = ref(true);
|
||||
let key = $ref(0);
|
||||
const key = ref(0);
|
||||
|
||||
const tick = () => {
|
||||
if (props.userListId == null) return;
|
||||
|
|
@ -59,7 +59,7 @@ const tick = () => {
|
|||
}).then(res => {
|
||||
notes.value = res;
|
||||
fetching.value = false;
|
||||
key++;
|
||||
key.value++;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onUnmounted } from 'vue';
|
||||
import { onUnmounted, ref } from 'vue';
|
||||
import { useStream } from '@/stream.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
|
|
@ -23,14 +23,14 @@ import { defaultStore } from '@/store.js';
|
|||
|
||||
const zIndex = os.claimZIndex('high');
|
||||
|
||||
let hasDisconnected = $ref(false);
|
||||
const hasDisconnected = ref(false);
|
||||
|
||||
function onDisconnected() {
|
||||
hasDisconnected = true;
|
||||
hasDisconnected.value = true;
|
||||
}
|
||||
|
||||
function resetDisconnected() {
|
||||
hasDisconnected = false;
|
||||
hasDisconnected.value = false;
|
||||
}
|
||||
|
||||
function reload() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue