Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AUTHORIZED_FETCH disclaimer to Actor Profile error messages #19

Merged
merged 8 commits into from
May 27, 2024
3 changes: 3 additions & 0 deletions actor-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ class ActorProfile extends HTMLElement {
pUserName.classList.add('profile-username')
pUserName.textContent = `@${actorInfo.preferredUsername}`
actorContainer.appendChild(pUserName) // Append to the actor container

// Dispatch event with username
this.dispatchEvent(new CustomEvent('usernameUpdated', { bubbles: true, detail: { username: actorInfo.preferredUsername } }))
}

if (actorInfo.summary) {
Expand Down
14 changes: 2 additions & 12 deletions profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@
</div>
</div>
<script>
// Pagination controls
document.addEventListener("outboxUpdated", () => {
const outboxElement = document.querySelector("distributed-outbox");
const prevButton = document.getElementById("prevPage");
const nextButton = document.getElementById("nextPage");

if (prevButton) {
prevButton.addEventListener("click", () => outboxElement.prevPage());
}
if (nextButton) {
nextButton.addEventListener("click", () => outboxElement.nextPage());
}
document.addEventListener('usernameUpdated', (event) => {
document.title = `@${event.detail.username}`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-05-16 at 11 55 33 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of replacing can we do a += so we can still identify the tab as being part of the social reader?

});

// Get actor url
Expand Down
Loading