diff --git a/packages/fakeyou.com/src/v2/view/pages/beta_key/BetaKeysListPage.tsx b/packages/fakeyou.com/src/v2/view/pages/beta_key/BetaKeysListPage.tsx index 2a3b17e0f0..829dd5f2a7 100644 --- a/packages/fakeyou.com/src/v2/view/pages/beta_key/BetaKeysListPage.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/beta_key/BetaKeysListPage.tsx @@ -77,7 +77,7 @@ export default function BetaKeysListPage() { // Create a new copy of the list const newList = [...list]; // Update the note for the specific row - newList[rowIndex] = { ...newList[rowIndex], maybe_note: note }; + newList[rowIndex] = { ...newList[rowIndex], maybe_note_html: note }; // Update the state with the new list listSet(newList); } @@ -195,15 +195,21 @@ export default function BetaKeysListPage() { ); }, }), - columnHelper.accessor("maybe_note", { + columnHelper.accessor("maybe_note_html", { id: "note", header: "Note", cell: info => { - const note = info.getValue(); - const { token, maybe_note_html } = info.row.original; + const noteHtml = info.getValue(); + const { token } = info.row.original; + + const stripHtml = (html: string) => { + const tmp = document.createElement("DIV"); + tmp.innerHTML = html; + return tmp.textContent || tmp.innerText || ""; + }; // eslint-disable-next-line react-hooks/rules-of-hooks - const [localNote, setLocalNote] = useState(note); + const [localNote, setLocalNote] = useState(stripHtml(noteHtml || "")); const handleLocalNoteChange = ( event: React.ChangeEvent @@ -230,15 +236,15 @@ export default function BetaKeysListPage() { ) : (
- + />