diff --git a/src/user/reporting/ReportMenu.tsx b/src/user/reporting/ReportMenu.tsx index dd055d88..23a128db 100644 --- a/src/user/reporting/ReportMenu.tsx +++ b/src/user/reporting/ReportMenu.tsx @@ -18,6 +18,7 @@ import { import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import DownloadIcon from "@mui/icons-material/Download"; +import { uInt8Array } from "util/uInt8Array"; interface ReportMenuProps { hasVerifiedConversions: boolean; @@ -27,19 +28,20 @@ export const ReportMenu = ({ campaignId, hasVerifiedConversions, }: ReportMenuProps) => { - const [privateKey, setPrivateKey] = useState(); const [dialogue, setDialogue] = useState(false); const [isError, setIsError] = useState(false); + const set = (s: string) => + document.getElementById("private-key")?.setAttribute("value", s); + const get = () => + document.getElementById("private-key")?.getAttribute("value"); const { download, loading, error } = useDownloadCSV({ onComplete() { setAnchorEl(null); setDialogue(false); - setPrivateKey(undefined); }, onError() { setIsError(true); setDialogue(false); - setPrivateKey(undefined); }, }); @@ -98,7 +100,13 @@ export const ReportMenu = ({ - setDialogue(false)}> + { + setDialogue(false); + // setPrivateKey(undefined); + }} + > Decrypt Conversion Data? @@ -110,13 +118,15 @@ export const ReportMenu = ({ be sent to or stored on any Brave servers. set(e.target.value)} autoFocus - onChange={(e) => setPrivateKey(e.target.value)} margin="normal" label="Private key" fullWidth variant="standard" /> + {loading && } @@ -129,7 +139,11 @@ export const ReportMenu = ({