Fix client-side errors

This commit is contained in:
2025-02-10 13:24:14 -05:00
parent 69f2759af5
commit 852ea63672
8 changed files with 28 additions and 20 deletions

View File

@@ -10,7 +10,7 @@
>
<img
class="w-full drop-shadow-[0_10px_6px_rgba(0,0,0,0.25)] h-60"
:src="brandingStore.value.images.banner ? brandingStore.value.images.banner : '/images/placeholders/banner.png'"
:src="brandingStore.value.images?.banner ?? '/images/placeholders/banner.png'"
alt="Profile Banner"
>
<!-- Tint Effect -->

View File

@@ -21,49 +21,56 @@ function GetSocialsUrls() {
const socials = [];
const brandingSocials = brandingStore.value.socials;
if (brandingSocials.facebookUrl) {
if (brandingSocials?.facebookUrl) {
socials.push({
icon: 'mdi-facebook',
url: brandingSocials.facebookUrl,
});
}
if (brandingSocials.instagramUrl) {
if (brandingSocials?.instagramUrl) {
socials.push({
icon: 'mdi-instagram',
url: brandingSocials.instagramUrl,
});
}
if (brandingSocials.xUrl) {
if (brandingSocials?.xUrl) {
socials.push({
icon: 'mdi-twitter',
url: brandingSocials.xUrl,
});
}
if (brandingSocials.linkedInUrl) {
if (brandingSocials?.linkedInUrl) {
socials.push({
icon: 'mdi-linkedin',
url: brandingSocials.linkedInUrl,
});
}
if (brandingSocials.tikTokUrl) {
if (brandingSocials?.tikTokUrl) {
socials.push({
icon: '/images/socials/tiktok-white.png',
url: brandingSocials.tikTokUrl,
});
}
if (brandingSocials.youtubeUrl) {
if (brandingSocials?.youtubeUrl) {
socials.push({
icon: 'mdi-youtube',
url: brandingSocials.youtubeUrl,
});
}
if (brandingSocials.redditUrl) {
if (brandingSocials?.redditUrl) {
socials.push({
icon: 'mdi-reddit',
url: brandingSocials.redditUrl,
});
}
if (brandingSocials.websiteUrl) {
if (brandingSocials?.websiteUrl) {
socials.push({
icon: 'mdi-web',
url: brandingSocials.websiteUrl,

View File

@@ -27,14 +27,12 @@ async function createAccount() {
isOperationPending.value = true;
const client = useClient();
errorMessage.value = '';
const normalizedCreatorName = creatorName.value.toLowerCase();
await client.post('/api/creators', {
creatorId: userProfileStore.user.id,
name: normalizedCreatorName,
slugReservationId: creatorNameReservationId.value,
});
await creatorProfileStore.fetchCurrentCreatorProfile();
await router.push(`/@${normalizedCreatorName}`);
await router.push(`/@${creatorProfileStore.creator.name}`);
} catch (error) {
if (error?.response?.data?.errors) {
errorMessage.value = error.response.data.errors[0]?.['reason'] || 'An unexpected error occurred.';

View File

@@ -445,6 +445,8 @@ function updateImage(field, event) {
// Charger les données au montage
onMounted(() => {
if (brandingStore.presentationInfos === undefined) return;
mainTitle.value = brandingStore.presentationInfos.title;
mainImageUrl.value = brandingStore.presentationInfos.mainImageUrl;
mainImageText.value = brandingStore.presentationInfos.mainImageText;

View File

@@ -7,9 +7,7 @@
<img
class="shadow-2xl rounded-full border-solid border-hSecondary border-102 max-w-[190px]"
:src="brandingStore.value.images.logo
? brandingStore.value.images.logo
: '/images/placeholders/logo.png'"
:src="brandingStore.value.images?.logo ?? '/images/placeholders/logo.png'"
alt="Profile Picture"
:style="{
height: '190px'