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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user