refactor findUserByDisplayName

This commit is contained in:
pa
2026-03-14 21:43:22 +09:00
parent a314885bff
commit a64f4f6d7a
10 changed files with 195 additions and 24 deletions
+7 -3
View File
@@ -1018,8 +1018,11 @@ export const useNotificationStore = defineStore('Notification', () => {
if (id) return id;
if (noty.displayName) {
return (
findUserByDisplayName(userStore.cachedUsers, noty.displayName)
?.id ?? ''
findUserByDisplayName(
userStore.cachedUsers,
noty.displayName,
userStore.cachedUserIdsByDisplayName
)?.id ?? ''
);
}
return '';
@@ -1086,7 +1089,8 @@ export const useNotificationStore = defineStore('Notification', () => {
} else if (noty.displayName) {
const ref = findUserByDisplayName(
userStore.cachedUsers,
noty.displayName
noty.displayName,
userStore.cachedUserIdsByDisplayName
);
if (ref) {
noty.isFriend = friendStore.friends.has(ref.id);