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

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;
});
}