diff --git a/src/Components/Document/DocumentListPage.js b/src/Components/Document/DocumentListPage.js index 0f9d0a9..6e083fe 100644 --- a/src/Components/Document/DocumentListPage.js +++ b/src/Components/Document/DocumentListPage.js @@ -171,7 +171,7 @@ const DocumentListPage = ({ perPage }) => { if (!group) { return null; } - + console.log("allDocs", allDocs); const DesktopContent = () => { return ( <> @@ -201,17 +201,17 @@ const DocumentListPage = ({ perPage }) => { )) ) : ( diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 162326f..9a45e21 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -40,7 +40,7 @@ const UploadModal = (props) => { process.env.NODE_ENV === "development" ? process.env.REACT_APP_API_DEV : process.env.REACT_APP_API_PROD; - + console.log("apiUrl", apiUrl); async function saveToDb(uuidName) { const createdAt = new Date(); const data = { @@ -69,16 +69,13 @@ const UploadModal = (props) => { setFileToParse(file); setFileChanged(true); } - + console.log("full request url:", `${apiUrl}/parseNewDoc`); async function uploadFile(file) { try { - const response = await fetch( - `https://www.novodraft.ai:4000/parseNewDoc`, - { - method: "POST", - body: file, - } - ); + const response = await fetch(`${apiUrl}/parseNewDoc`, { + method: "POST", + body: file, + }); const res = response; return res; } catch (error) { diff --git a/src/pageElements/Cards.js b/src/pageElements/Cards.js index 476dffa..7d990a6 100644 --- a/src/pageElements/Cards.js +++ b/src/pageElements/Cards.js @@ -275,9 +275,16 @@ export const DocCard = (props) => { confirmDelete, createdAt, } = props; + const createdAtTime = createdAt?.seconds + ? createdAt?.seconds + : new Date().getTime(); const now = new Date().getTime(); - const uploadedAt = createdAt.toDate(); + const uploadedAt = new Date(createdAtTime * 1000); const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15; + console.log( + "(now - uploadedAt) / 60 / 1000)", + (now - uploadedAt) / 60 / 1000 + ); const disabled = docType ? false : true; const tooltipText = "Parsing is taking a bit longer than usual. This usually resolves within 15 minutes. If it does not, click “report” and support will address the issue within 24 hours."; diff --git a/src/styles/cards.scss b/src/styles/cards.scss index 2d1f056..eaefca3 100644 --- a/src/styles/cards.scss +++ b/src/styles/cards.scss @@ -199,7 +199,7 @@ display: flex; justify-content: flex-end; align-items: center; - width: 90px; + width: 120px; height: 100%; padding-right: 10px; margin-right: 20px;