fix(front): fix showing current group avatar & banners
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
02867e6e14
commit
20b4aaabc9
@ -262,38 +262,17 @@ const copyURL = async (): Promise<void> => {
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
onGroupResult(({ data }) => {
|
onGroupResult(async ({ data }) => {
|
||||||
|
if (!data) return;
|
||||||
editableGroup.value = data.group;
|
editableGroup.value = data.group;
|
||||||
});
|
try {
|
||||||
|
avatarFile.value = await buildFileFromIMedia(editableGroup.value?.avatar);
|
||||||
watch(
|
bannerFile.value = await buildFileFromIMedia(editableGroup.value?.banner);
|
||||||
group,
|
} catch (e) {
|
||||||
async (newGroup: IGroup | undefined, oldGroup: IGroup | undefined) => {
|
// Catch errors while building media
|
||||||
console.debug("watching group");
|
console.error(e);
|
||||||
if (!newGroup) return;
|
|
||||||
try {
|
|
||||||
if (
|
|
||||||
oldGroup?.avatar !== undefined &&
|
|
||||||
oldGroup?.avatar !== newGroup?.avatar
|
|
||||||
) {
|
|
||||||
avatarFile.value = await buildFileFromIMedia(newGroup?.avatar);
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
oldGroup?.banner !== undefined &&
|
|
||||||
oldGroup?.banner !== newGroup?.banner
|
|
||||||
) {
|
|
||||||
bannerFile.value = await buildFileFromIMedia(newGroup?.banner);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// Catch errors while building media
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
editableGroup.value = { ...newGroup };
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true,
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
const buildVariables = computed(() => {
|
const buildVariables = computed(() => {
|
||||||
let avatarObj = {};
|
let avatarObj = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user