Skip to content

Commit

Permalink
Fixed Speaker social save error and in modal toast styling issue (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai authored Nov 11, 2024
1 parent c18f1cb commit bac980d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ecc/components/profile/profile.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,10 @@ modal{
.edit-profile-title {
color: var(--color-red);
}
sp-theme.toast-area {
position: absolute;
bottom: 2rem;
right: 2rem
}
`;
2 changes: 1 addition & 1 deletion ecc/components/profile/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 8 additions & 3 deletions ecc/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bac980d

Please sign in to comment.