From 18637bbbc193f970c03c9b19d522fff29390273f Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 20 Aug 2024 11:44:34 +0200 Subject: [PATCH] fix: update verify to use file signature check --- src/pages/verify/index.tsx | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/pages/verify/index.tsx b/src/pages/verify/index.tsx index 865310e..ceba0eb 100644 --- a/src/pages/verify/index.tsx +++ b/src/pages/verify/index.tsx @@ -170,17 +170,23 @@ export const VerifyPage = () => { const [currentFileHashes, setCurrentFileHashes] = useState<{ [key: string]: string | null - }>(fileHashes) + }>({}) const [files, setFiles] = useState<{ [filename: string]: PdfFile }>({}) const [currentFile, setCurrentFile] = useState(null) + const [signatureFileHashes, setSignatureFileHashes] = useState<{ + [key: string]: string + }>(fileHashes) + + useEffect(() => { + setSignatureFileHashes(fileHashes) + }, [fileHashes]) useEffect(() => { if (Object.entries(files).length > 0) { - const tmp = getCurrentUserFiles(files, fileHashes) - + const tmp = getCurrentUserFiles(files, fileHashes, signatureFileHashes) setCurrentFile(tmp[0]) } - }, [fileHashes, files]) + }, [signatureFileHashes, fileHashes, files]) const usersPubkey = useSelector((state: State) => state.auth.usersPubkey) const nostrController = NostrController.getInstance() @@ -524,7 +530,11 @@ export const VerifyPage = () => { <> {currentFile !== null && ( { >