more
This commit is contained in:
@@ -45,6 +45,7 @@ const DocEditPage = () => {
|
|||||||
);
|
);
|
||||||
const [index, setIndex] = useState(0);
|
const [index, setIndex] = useState(0);
|
||||||
const [isBusy, setIsBusy] = useState(false);
|
const [isBusy, setIsBusy] = useState(false);
|
||||||
|
const fbUserId = group ? group.fbAuthUid : null;
|
||||||
// For document generation:
|
// For document generation:
|
||||||
const state = group?.state[0] ? group.state[0].code : "ny";
|
const state = group?.state[0] ? group.state[0].code : "ny";
|
||||||
const lawFirm = group ? group?.firm : null;
|
const lawFirm = group ? group?.firm : null;
|
||||||
@@ -287,6 +288,7 @@ const DocEditPage = () => {
|
|||||||
});
|
});
|
||||||
setResponses(result);
|
setResponses(result);
|
||||||
updateRespGenerationCount(documentId);
|
updateRespGenerationCount(documentId);
|
||||||
|
updateUserAccountDocsGenerated(fbUserId);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
})
|
})
|
||||||
.catch((err) => console.log(err));
|
.catch((err) => console.log(err));
|
||||||
@@ -449,6 +451,12 @@ const DocEditPage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function updateUserAccountDocsGenerated(fbUserId) {
|
||||||
|
await updateDoc(doc(db, "users", fbUserId), {
|
||||||
|
docsGenerated: increment(1),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function updateRespGenerationCount(docId) {
|
async function updateRespGenerationCount(docId) {
|
||||||
await updateDoc(doc(db, "documents", docId), {
|
await updateDoc(doc(db, "documents", docId), {
|
||||||
responseGenerations: increment(1),
|
responseGenerations: increment(1),
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ export const DocCard = (props) => {
|
|||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
const uploadedAt = new Date(createdAtTime * 1000);
|
const uploadedAt = new Date(createdAtTime * 1000);
|
||||||
const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15;
|
const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15;
|
||||||
|
console.log("responseGenerations", responseGenerations);
|
||||||
const disabled = docType ? false : true;
|
const disabled = docType ? false : true;
|
||||||
const tooltipText =
|
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.";
|
"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.";
|
||||||
|
|||||||
Reference in New Issue
Block a user