diff --git a/ecc/components/profile/profile.css.js b/ecc/components/profile/profile.css.js index a515fb30..17111bea 100644 --- a/ecc/components/profile/profile.css.js +++ b/ecc/components/profile/profile.css.js @@ -170,4 +170,10 @@ modal{ .edit-profile-title { color: var(--color-red); } + +sp-theme.toast-area { + position: absolute; + bottom: 2rem; + right: 2rem +} `; diff --git a/ecc/components/profile/profile.js b/ecc/components/profile/profile.js index 972e5eee..55ce2efe 100644 --- a/ecc/components/profile/profile.js +++ b/ecc/components/profile/profile.js @@ -103,7 +103,7 @@ export class Profile extends LitElement { try { const profile = edited ? structuredClone(this.profileCopy) : structuredClone(this.profile); - const correctSocialMedia = profile.socialMedia.filter((sm) => sm.link !== '' && sm.link?.match(LINK_REGEX)); + const correctSocialMedia = profile.socialMedia.filter((sm) => sm.link === '' || sm.link?.match(LINK_REGEX)); if (correctSocialMedia.length < profile.socialMedia.length) { const dialogToastParent = edited ? this.shadowRoot.querySelector('.edit-profile-dialog') : null; diff --git a/ecc/scripts/utils.js b/ecc/scripts/utils.js index 9ccdcc79..55181b29 100644 --- a/ecc/scripts/utils.js +++ b/ecc/scripts/utils.js @@ -283,9 +283,14 @@ export async function getSecret(key) { } export function getServiceName(link) { - const url = new URL(link); - - return url.hostname.replace('.com', '').replace('www.', ''); + try { + const url = new URL(link); + const { hostname } = url; + return hostname.replace('.com', '').replace('www.', ''); + } catch (error) { + window.lana?.log('Error trying to get service name:', error); + return ''; + } } export async function miloReplaceKey(key) {