Misc fixes

This commit is contained in:
Natsumi
2025-07-22 01:53:48 +12:00
parent 4fd898d84d
commit b9b0cebd7f
11 changed files with 53 additions and 49 deletions
+1 -10
View File
@@ -369,9 +369,6 @@ export const useFriendStore = defineStore('Friend', () => {
function updateLocalFavoriteFriends() {
const favoriteStore = useFavoriteStore();
const { cachedFavorites } = favoriteStore;
generalSettingsStore.setLocalFavoriteFriendsGroups(
generalSettingsStore.localFavoriteFriendsGroups
);
state.localFavoriteFriends.clear();
for (const ref of cachedFavorites.values()) {
if (
@@ -1112,13 +1109,7 @@ export const useFriendStore = defineStore('Friend', () => {
}
const ref = userStore.cachedUsers.get(id);
if (typeof ref === 'undefined') {
try {
userRequest.getUser({
userId: id
});
} catch (err) {
console.error('Fetch user on add as friend', err);
}
// deleted account on friends list
return;
}
friendRequest
+13 -5
View File
@@ -11,7 +11,7 @@ import { $app } from '../app';
import configRepository from '../service/config';
import { watchState } from '../service/watchState';
import { groupDialogFilterOptions } from '../shared/constants/';
import { replaceBioSymbols } from '../shared/utils';
import { replaceBioSymbols, convertFileUrlToImageUrl } from '../shared/utils';
import { useGameStore } from './game';
import { useInstanceStore } from './instance';
import { useUserStore } from './user';
@@ -685,9 +685,6 @@ export const useGroupStore = defineStore('Group', () => {
// keep roleIds
json.myMember.roleIds = ref.myMember.roleIds;
}
if (typeof json.myMember.isRepresenting !== 'undefined') {
json.myMember.isRepresenting = ref.myMember.isRepresenting;
}
Object.assign(ref.myMember, json.myMember);
}
Object.assign(ref, json);
@@ -722,11 +719,23 @@ export const useGroupStore = defineStore('Group', () => {
}
function handleGroupRepresented(args) {
const D = userStore.userDialog;
const json = args.json;
D.representedGroup = json;
D.representedGroup.$thumbnailUrl = convertFileUrlToImageUrl(
json.iconUrl
);
if (!json || !json.isRepresenting) {
D.isRepresentedGroupLoading = false;
}
if (!json.groupId) {
// no group
return;
}
if (args.params.userId !== userStore.currentUser.id) {
// not current user, don't apply someone elses myMember
return;
}
json.$memberId = json.id;
json.id = json.groupId;
applyGroup(json);
@@ -1002,7 +1011,6 @@ export const useGroupStore = defineStore('Group', () => {
})
.then((args) => {
handleGroupRepresented(args);
userStore.userDialog.representedGroup = args.json;
return args;
});
}
+3
View File
@@ -6,10 +6,12 @@ import { t } from '../../plugin';
import configRepository from '../../service/config';
import { useVrcxStore } from '../vrcx';
import { useVRCXUpdaterStore } from '../vrcxUpdater';
import { useFriendStore } from '../friend';
export const useGeneralSettingsStore = defineStore('GeneralSettings', () => {
const vrcxStore = useVrcxStore();
const VRCXUpdaterStore = useVRCXUpdaterStore();
const friendStore = useFriendStore();
const state = reactive({
isStartAtWindowsStartup: false,
isStartAsMinimizedState: false,
@@ -184,6 +186,7 @@ export const useGeneralSettingsStore = defineStore('GeneralSettings', () => {
'VRCX_localFavoriteFriendsGroups',
JSON.stringify(value)
);
friendStore.updateLocalFavoriteFriends();
}
function setUdonExceptionLogging() {
state.udonExceptionLogging = !state.udonExceptionLogging;
-9
View File
@@ -20,7 +20,6 @@ import {
compareByLocationAt,
compareByName,
compareByUpdatedAt,
convertFileUrlToImageUrl,
extractFileId,
getAllUserMemos,
getGroupName,
@@ -947,14 +946,6 @@ export const useUserStore = defineStore('User', () => {
.getRepresentedGroup({ userId })
.then((args1) => {
groupStore.handleGroupRepresented(args1);
D.representedGroup = args1.json;
D.representedGroup.$thumbnailUrl =
convertFileUrlToImageUrl(
args1.json.iconUrl
);
if (!args1.json || !args1.json.isRepresenting) {
D.isRepresentedGroupLoading = false;
}
});
D.loading = false;
});