From d8f28f98e9d9261168a0217e51bf109447c662e3 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 26 Oct 2025 20:06:02 -0400 Subject: [PATCH] Ensure friends list shows unfriend button when manageable --- js/ui/profileModalController.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/js/ui/profileModalController.js b/js/ui/profileModalController.js index d050d2d1..cb4cf64f 100644 --- a/js/ui/profileModalController.js +++ b/js/ui/profileModalController.js @@ -3893,6 +3893,7 @@ export class ProfileModalController { : (value) => (typeof value === "string" ? value : ""); const entriesNeedingFetch = new Set(); + const canRemoveFriends = this.canManageFriendsList(); deduped.forEach(({ hex, label }) => { const item = document.createElement("li"); @@ -3946,7 +3947,7 @@ export class ProfileModalController { actions.appendChild(copyButton); } - if (hex && !usedModerationService) { + if (hex && canRemoveFriends) { const removeButton = this.createRemoveButton({ label: "Unfriend", onRemove: () => this.handleRemoveFriend(hex), @@ -3983,6 +3984,21 @@ export class ProfileModalController { } } + canManageFriendsList() { + if ( + this.moderationService && + (!this.subscriptionsService || + typeof this.subscriptionsService.removeChannel !== "function") + ) { + return false; + } + + return ( + this.subscriptionsService && + typeof this.subscriptionsService.removeChannel === "function" + ); + } + clearFriendsList() { if (this.friendList instanceof HTMLElement) { this.friendList.innerHTML = "";