Compare commits

...

1 Commits
main ... main

Author SHA1 Message Date
vivganes e12e18474c respect debug menu prefs + one more debug menu item 2023-12-28 13:31:39 +00:00
2 changed files with 24 additions and 8 deletions

View File

@ -118,6 +118,10 @@ export function NoteContextMenu({ ev, ...props }: NosteContextMenuProps) {
await navigator.clipboard.writeText(JSON.stringify(ev, undefined, " "));
}
async function copyAuthorHexPubkey() {
await navigator.clipboard.writeText(ev.pubkey);
}
const handleReBroadcastButtonClick = () => {
setShowBroadcast(true);
};
@ -152,10 +156,12 @@ export function NoteContextMenu({ ev, ...props }: NosteContextMenuProps) {
<FormattedMessage {...messages.Bookmark} />
</MenuItem>
)}
<MenuItem onClick={() => copyId()}>
<Icon name="copy" />
<FormattedMessage {...messages.CopyID} />
</MenuItem>
{login.appData.item.preferences.showDebugMenus && (
<MenuItem onClick={() => copyId()}>
<Icon name="copy" />
<FormattedMessage {...messages.CopyID} />
</MenuItem>
)}
{!login.readonly && (
<MenuItem onClick={() => mute(ev.pubkey)}>
<Icon name="mute" />
@ -182,10 +188,19 @@ export function NoteContextMenu({ ev, ...props }: NosteContextMenuProps) {
<Icon name="translate" />
<FormattedMessage {...messages.TranslateTo} values={{ lang: langNames.of(lang.split("-")[0]) }} />
</MenuItem>
<MenuItem onClick={() => copyEvent()}>
<Icon name="json" />
<FormattedMessage {...messages.CopyJSON} />
</MenuItem>
{login.appData.item.preferences.showDebugMenus && (
<MenuItem onClick={() => copyEvent()}>
<Icon name="json" />
<FormattedMessage {...messages.CopyJSON} />
</MenuItem>
)}
{login.appData.item.preferences.showDebugMenus && (
<MenuItem onClick={() => copyAuthorHexPubkey()}>
<Icon name="key" />
<FormattedMessage {...messages.CopyAuthorHexPubkey} />
</MenuItem>
)}
{isMine && !login.readonly && (
<MenuItem onClick={() => deleteEvent()}>
<Icon name="trash" className="red" />

View File

@ -43,6 +43,7 @@ export default defineMessages({
Share: { defaultMessage: "Share", id: "OKhRC6" },
CopyID: { defaultMessage: "Copy ID", id: "wtLjP6" },
CopyJSON: { defaultMessage: "Copy Event JSON", id: "P61BTu" },
CopyAuthorHexPubkey: { defaultMessage: "Copy Author Hex Pubkey", id: "3SERAN" },
Dislike: { defaultMessage: "{n} Dislike", id: "GspYR7" },
DislikeAction: { defaultMessage: "Dislike", id: "4OB335" },
Sats: { defaultMessage: `{n} {n, plural, =1 {sat} other {sats}}`, id: "jA3OE/" },