remove unnecessary getUser

This commit is contained in:
pa
2026-02-11 23:00:27 +09:00
parent b0bc6dd03c
commit 1ef618f358
+11 -29
View File
@@ -874,7 +874,8 @@ export const useUserStore = defineStore('User', () => {
}) })
.then((args) => { .then((args) => {
if (args.ref.id === D.id) { if (args.ref.id === D.id) {
requestAnimationFrame(() => { D.loading = false;
D.ref = args.ref; D.ref = args.ref;
uiStore.setDialogCrumbLabel( uiStore.setDialogCrumbLabel(
'user', 'user',
@@ -906,22 +907,16 @@ export const useUserStore = defineStore('User', () => {
} }
} }
} }
D.isFavorite = D.isFavorite = favoriteStore.getCachedFavoritesByObjectId(
favoriteStore.getCachedFavoritesByObjectId(D.id); D.id
);
if (D.ref.friendRequestStatus === 'incoming') { if (D.ref.friendRequestStatus === 'incoming') {
D.incomingRequest = true; D.incomingRequest = true;
} else if (D.ref.friendRequestStatus === 'outgoing') { } else if (D.ref.friendRequestStatus === 'outgoing') {
D.outgoingRequest = true; D.outgoingRequest = true;
} }
userRequest.getUser(args.params).then((args1) => {
if (args1.ref.id === D.id) {
D.loading = false;
}
});
let inCurrentWorld = false; let inCurrentWorld = false;
if ( if (locationStore.lastLocation.playerList.has(D.ref.id)) {
locationStore.lastLocation.playerList.has(D.ref.id)
) {
inCurrentWorld = true; inCurrentWorld = true;
} }
if (userId !== currentUser.value.id) { if (userId !== currentUser.value.id) {
@@ -938,29 +933,21 @@ export const useUserStore = defineStore('User', () => {
const userNotifications = const userNotifications =
await database.getFriendLogHistoryForUserId( await database.getFriendLogHistoryForUserId(
D.id, D.id,
[ ['DisplayName', 'Friend', 'Unfriend']
'DisplayName',
'Friend',
'Unfriend'
]
); );
const dateFriendedInfo = []; const dateFriendedInfo = [];
for (const notification of userNotifications) { for (const notification of userNotifications) {
if (notification.userId !== D.id) { if (notification.userId !== D.id) {
continue; continue;
} }
if ( if (notification.type === 'DisplayName') {
notification.type === 'DisplayName'
) {
displayNameMap.set( displayNameMap.set(
notification.previousDisplayName, notification.previousDisplayName,
notification.created_at notification.created_at
); );
} }
if (!D.dateFriended) { if (!D.dateFriended) {
if ( if (notification.type === 'Unfriend') {
notification.type === 'Unfriend'
) {
D.unFriended = true; D.unFriended = true;
if ( if (
!appearanceSettingsStore.hideUnfriends !appearanceSettingsStore.hideUnfriends
@@ -969,9 +956,7 @@ export const useUserStore = defineStore('User', () => {
notification.created_at; notification.created_at;
} }
} }
if ( if (notification.type === 'Friend') {
notification.type === 'Friend'
) {
D.unFriended = false; D.unFriended = false;
D.dateFriended = D.dateFriended =
notification.created_at; notification.created_at;
@@ -982,9 +967,7 @@ export const useUserStore = defineStore('User', () => {
(notification.type === 'Unfriend' && (notification.type === 'Unfriend' &&
!appearanceSettingsStore.hideUnfriends) !appearanceSettingsStore.hideUnfriends)
) { ) {
dateFriendedInfo.unshift( dateFriendedInfo.unshift(notification);
notification
);
} }
} }
D.dateFriendedInfo = dateFriendedInfo; D.dateFriendedInfo = dateFriendedInfo;
@@ -1044,7 +1027,6 @@ export const useUserStore = defineStore('User', () => {
}); });
D.visible = true; D.visible = true;
applyUserDialogLocation(true); applyUserDialogLocation(true);
});
} }
}); });
showUserDialogHistory.delete(userId); showUserDialogHistory.delete(userId);