fix: use consistent encrypted content detection for padlock and decrypt button

Fixed mismatch between padlock display and decrypt button visibility:
- Both now use Helpers.hasHiddenContent() and Helpers.hasHiddenTags()
- Previously padlock showed for ANY content, button only for encrypted
- Now both correctly detect actual encrypted content

This ensures decrypt buttons appear whenever padlocks are shown.
This commit is contained in:
Gigi
2025-10-17 21:27:02 +02:00
parent 9a03dd312f
commit f3205843ac

View File

@@ -97,10 +97,10 @@ const Debug: React.FC<DebugProps> = ({ relayPool }) => {
const getBookmarkCount = (evt: NostrEvent): { public: number; private: number } => {
const publicTags = (evt.tags || []).filter((t: string[]) => t[0] === 'e' || t[0] === 'a')
const hasPrivate = evt.content && evt.content.length > 0
const hasEncrypted = Helpers.hasHiddenContent(evt) || (Helpers.hasHiddenTags(evt) && !Helpers.isHiddenTagsUnlocked(evt))
return {
public: publicTags.length,
private: hasPrivate ? 1 : 0 // Can't know exact count until decrypted
private: hasEncrypted ? 1 : 0 // Can't know exact count until decrypted
}
}