mirror of
https://github.com/dergigi/boris.git
synced 2025-12-24 10:04:19 +01:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user