Skip to content

Commit

Permalink
Fix admin copy bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
golf1052 committed Nov 21, 2024
1 parent 00c3622 commit 391d4f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SeattleCarsInBikeLanes/wwwroot/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ function createDesktopCard(key, metadatas) {
copyButton.addEventListener('click', function() {
const carString = metadata.numberOfCars === 1 ? 'car' : 'cars';
let submissionString = 'Submission';
if (metadata.mastodonSubmittedBy !== 'Submission') {
if (metadata.mastodonSubmittedBy && metadata.mastodonSubmittedBy !== 'Submission') {
const splitMastodonSubmittedBy = metadata.mastodonSubmittedBy.split(' ');
const splitUsername = splitMastodonSubmittedBy[2].split('@');
submissionString = `Submitted by https://${splitUsername[2]}/@${splitUsername[1]}`;
}
if (submissionString === 'Submission') {
if (submissionString === 'Submission' && metadata.blueskySubmittedBy && metadata.blueskySubmittedBy !== 'Submission') {
const splitBlueskySubmittedBy = metadata.blueskySubmittedBy.split(' ');
const splitHandle = splitBlueskySubmittedBy[2].split('@');
submissionString = `Submitted by https://bsky.app/profile/${splitHandle[1]}`;
Expand Down

0 comments on commit 391d4f5

Please sign in to comment.