forked from Kieran/snort
feat: copy event json
This commit is contained in:
parent
0f5364a7be
commit
079b4ff9a9
@ -141,6 +141,10 @@ export default function NoteFooter(props: NoteFooterProps) {
|
|||||||
await navigator.clipboard.writeText(hexToBech32("note", ev.Id));
|
await navigator.clipboard.writeText(hexToBech32("note", ev.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function copyEvent() {
|
||||||
|
await navigator.clipboard.writeText(JSON.stringify(ev.Original, undefined, ' '));
|
||||||
|
}
|
||||||
|
|
||||||
function menuItems() {
|
function menuItems() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -160,7 +164,12 @@ export default function NoteFooter(props: NoteFooterProps) {
|
|||||||
<FontAwesomeIcon icon={faCopy} />
|
<FontAwesomeIcon icon={faCopy} />
|
||||||
Copy ID
|
Copy ID
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
{prefs.showDebugMenus && (
|
||||||
|
<MenuItem onClick={() => copyEvent()}>
|
||||||
|
<FontAwesomeIcon icon={faCopy} />
|
||||||
|
Copy Event JSON
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
{isMine && (
|
{isMine && (
|
||||||
<MenuItem onClick={() => deleteEvent()}>
|
<MenuItem onClick={() => deleteEvent()}>
|
||||||
<FontAwesomeIcon icon={faTrash} className="red" />
|
<FontAwesomeIcon icon={faTrash} className="red" />
|
||||||
|
@ -50,6 +50,15 @@ const PreferencesPage = () => {
|
|||||||
<input type="checkbox" checked={perf.confirmReposts} onChange={e => dispatch(setPreferences({ ...perf, confirmReposts: e.target.checked }))} />
|
<input type="checkbox" checked={perf.confirmReposts} onChange={e => dispatch(setPreferences({ ...perf, confirmReposts: e.target.checked }))} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="card flex">
|
||||||
|
<div className="flex f-col f-grow">
|
||||||
|
<div>Debug Menus</div>
|
||||||
|
<small>Shows extra options to help with debugging data</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" checked={perf.showDebugMenus} onChange={e => dispatch(setPreferences({ ...perf, showDebugMenus: e.target.checked }))} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,12 @@ export interface UserPreferences {
|
|||||||
/**
|
/**
|
||||||
* Ask for confirmation when reposting notes
|
* Ask for confirmation when reposting notes
|
||||||
*/
|
*/
|
||||||
confirmReposts: boolean
|
confirmReposts: boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show debugging menus to help diagnose issues
|
||||||
|
*/
|
||||||
|
showDebugMenus: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LoginStore {
|
export interface LoginStore {
|
||||||
@ -104,7 +109,8 @@ const InitState = {
|
|||||||
enableReactions: true,
|
enableReactions: true,
|
||||||
autoLoadMedia: true,
|
autoLoadMedia: true,
|
||||||
theme: "system",
|
theme: "system",
|
||||||
confirmReposts: false
|
confirmReposts: false,
|
||||||
|
showDebugMenus: false
|
||||||
}
|
}
|
||||||
} as LoginStore;
|
} as LoginStore;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user