From b5b962b1987243a8941bf92debac997f1764de1c Mon Sep 17 00:00:00 2001 From: pa Date: Mon, 14 Jul 2025 21:28:13 +0900 Subject: [PATCH] clean --- src/api/group.js | 2 +- .../dialogs/WorldDialog/WorldDialog.vue | 6 +++--- src/shared/utils/memos.js | 18 +++++++++--------- src/stores/notification.js | 4 ++-- src/types/globals.d.ts | 1 - 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/api/group.js b/src/api/group.js index e9d4969a..a5c0dbb2 100644 --- a/src/api/group.js +++ b/src/api/group.js @@ -664,7 +664,7 @@ const groupReq = { method: 'GET', params }).then((json) => { - var args = { + const args = { json, params }; diff --git a/src/components/dialogs/WorldDialog/WorldDialog.vue b/src/components/dialogs/WorldDialog/WorldDialog.vue index 80154a26..79dc6433 100644 --- a/src/components/dialogs/WorldDialog/WorldDialog.vue +++ b/src/components/dialogs/WorldDialog/WorldDialog.vue @@ -1250,9 +1250,9 @@ if (action === 'confirm' && instance.inputValue !== world.ref.previewYoutubeId) { if (instance.inputValue.length > 11) { try { - var url = new URL(instance.inputValue); - var id1 = url.pathname; - var id2 = url.searchParams.get('v'); + const url = new URL(instance.inputValue); + const id1 = url.pathname; + const id2 = url.searchParams.get('v'); if (id1 && id1.length === 12) { instance.inputValue = id1.substring(1, 12); } diff --git a/src/shared/utils/memos.js b/src/shared/utils/memos.js index 20057cdc..a60e481f 100644 --- a/src/shared/utils/memos.js +++ b/src/shared/utils/memos.js @@ -6,11 +6,11 @@ import { useFriendStore } from '../../stores'; * @returns {Promise} */ async function migrateMemos() { - var json = JSON.parse(await VRCXStorage.GetAll()); - for (var line in json) { + const json = JSON.parse(await VRCXStorage.GetAll()); + for (const line in json) { if (line.substring(0, 8) === 'memo_usr') { - var userId = line.substring(5); - var memo = json[line]; + const userId = line.substring(5); + const memo = json[line]; if (memo) { await saveUserMemo(userId, memo); VRCXStorage.Remove(`memo_${userId}`); @@ -54,11 +54,11 @@ async function saveUserMemo(id, memo) { } else { await database.deleteUserMemo(id); } - var ref = friends.value.get(id); + const ref = friends.value.get(id); if (ref) { ref.memo = String(memo || ''); if (memo) { - var array = memo.split('\n'); + const array = memo.split('\n'); ref.$nickName = array[0]; } else { ref.$nickName = ''; @@ -72,14 +72,14 @@ async function saveUserMemo(id, memo) { async function getAllUserMemos() { const friendStore = useFriendStore(); const { friends } = storeToRefs(friendStore); - var memos = await database.getAllUserMemos(); + const memos = await database.getAllUserMemos(); memos.forEach((memo) => { - var ref = friends.value.get(memo.userId); + const ref = friends.value.get(memo.userId); if (typeof ref !== 'undefined') { ref.memo = memo.memo; ref.$nickName = ''; if (memo.memo) { - var array = memo.memo.split('\n'); + const array = memo.memo.split('\n'); ref.$nickName = array[0]; } } diff --git a/src/stores/notification.js b/src/stores/notification.js index 4675874d..f47492a8 100644 --- a/src/stores/notification.js +++ b/src/stores/notification.js @@ -762,7 +762,7 @@ export const useNotificationStore = defineStore('Notification', () => { ); break; case 'Online': - var locationName = ''; + let locationName = ''; if (noty.worldName) { locationName = ` to ${displayLocation( noty.location, @@ -2238,7 +2238,7 @@ export const useNotificationStore = defineStore('Notification', () => { noty.isFriend = friendStore.friends.has(noty.userId); noty.isFavorite = friendStore.localFavoriteFriends.has(noty.userId); } else if (noty.displayName) { - for (var ref of userStore.cachedUsers.values()) { + for (const ref of userStore.cachedUsers.values()) { if (ref.displayName === noty.displayName) { noty.isFriend = friendStore.friends.has(ref.id); noty.isFavorite = friendStore.localFavoriteFriends.has( diff --git a/src/types/globals.d.ts b/src/types/globals.d.ts index dd31dab2..9a03292d 100644 --- a/src/types/globals.d.ts +++ b/src/types/globals.d.ts @@ -6,7 +6,6 @@ declare global { interface Window { $app: any; - API: API; AppApi: AppApi; WebApi: WebApi; VRCXStorage: VRCXStorage;