From 62680933f352bbfc4cb6ca3140847573cba19c2c Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sat, 30 Mar 2024 13:57:40 -0400 Subject: [PATCH 1/2] do not wait for synchronization with subgraph --- vue-app/src/locales/cn.json | 4 ++-- vue-app/src/locales/en.json | 4 ++-- vue-app/src/locales/es.json | 4 ++-- vue-app/src/utils/contracts.ts | 33 ------------------------------ vue-app/src/views/JoinView.vue | 10 +++------ vue-app/src/views/ProjectAdded.vue | 22 ++++++++------------ 6 files changed, 17 insertions(+), 60 deletions(-) diff --git a/vue-app/src/locales/cn.json b/vue-app/src/locales/cn.json index 693ba2260..a95b93b08 100644 --- a/vue-app/src/locales/cn.json +++ b/vue-app/src/locales/cn.json @@ -728,8 +728,8 @@ "div1": "您快要参加这筹款活动了。", "li1": "您的项目只需要经过一些最终检查来确保它符合筹款标准。您可以在这里", "link1": "了解更多关于注册流程的信息。", - "li2": "完成后,您的项目页面将上线。", - "li3": " 如果您的项目未通过检查,我们将电邮通知您并退回您的押金。", + "li2": "完成后,您的项目页面将上线, 我们将退还您的押金。", + "li3": " 如果您的项目未通过检查,我们将退回您的押金。", "linkProjects": "查看项目", "link2": "查看项目", "link3": "回首页" diff --git a/vue-app/src/locales/en.json b/vue-app/src/locales/en.json index 89dd5781e..8db5b2e14 100644 --- a/vue-app/src/locales/en.json +++ b/vue-app/src/locales/en.json @@ -728,8 +728,8 @@ "div1": "You’re almost on board this funding round.", "li1": "Your project just needs to go through some final checks to ensure it meets round criteria. You can", "link1": "learn more about the registration process here.", - "li2": "Once that's complete, your project page will go live.", - "li3": " If your project fails any checks, we'll let you know by email and return your deposit.", + "li2": "Once that's complete, your project page will go live and we'll refund your deposit.", + "li3": " If your project fails any checks, we'll return your deposit.", "linkProjects": "View projects", "link2": "View project", "link3": "Go home" diff --git a/vue-app/src/locales/es.json b/vue-app/src/locales/es.json index 54b0f04dc..704996105 100644 --- a/vue-app/src/locales/es.json +++ b/vue-app/src/locales/es.json @@ -728,8 +728,8 @@ "div1": "Estás casi listo para unirte a esta ronda de financiamiento.", "li1": "Tu proyecto solo necesita pasar por algunas verificaciones finales para asegurarse de que cumpla con los criterios de la ronda. Puedes", "link1": "obtener más información sobre el proceso de registro aquí.", - "li2": "Una vez que se complete, la página de tu proyecto se publicará.", - "li3": "Si tu proyecto no pasa alguna verificación, te lo haremos saber por correo electrónico y te devolveremos tu depósito.", + "li2": "Una vez que se complete, la página de tu proyecto se publicará y te devolveremos tu depósito.", + "li3": "Si tu proyecto no pasa alguna verificación, te devolveremos tu depósito.", "linkProjects": "Ver proyectos", "link2": "Ver proyecto", "link3": "Ir a inicio" diff --git a/vue-app/src/utils/contracts.ts b/vue-app/src/utils/contracts.ts index 6df726b50..640152451 100644 --- a/vue-app/src/utils/contracts.ts +++ b/vue-app/src/utils/contracts.ts @@ -47,39 +47,6 @@ export async function waitForTransaction( return transactionReceipt } -/** - * Wait for transaction to be mined and available on the subgraph - * @param pendingTransaction transaction to wait and check for - * @param checkFn the check function - * @param onTransactionHash callback function with the transaction hash - * @returns transaction receipt - */ -export async function waitForTransactionAndCheck( - pendingTransaction: Promise, - checkFn: (receipt: TransactionReceipt) => Promise, - onTransactionHash?: (hash: string) => void, -): Promise { - const receipt = await waitForTransaction(pendingTransaction, onTransactionHash) - - return new Promise(resolve => { - async function checkAndWait(depth = 0) { - if (await checkFn(receipt)) { - resolve(receipt) - } else { - if (depth > MAX_WAIT_DEPTH) { - throw new Error('Time out waiting for transaction ' + receipt.hash) - } - - const timeoutMs = 2 ** depth * 10 - await new Promise(res => setTimeout(res, timeoutMs)) - checkAndWait(depth + 1) - } - } - - checkAndWait() - }) -} - export async function isTransactionMined(hash: string): Promise { const receipt = await provider.getTransactionReceipt(hash) return !!receipt diff --git a/vue-app/src/views/JoinView.vue b/vue-app/src/views/JoinView.vue index 547658557..d87736942 100644 --- a/vue-app/src/views/JoinView.vue +++ b/vue-app/src/views/JoinView.vue @@ -717,12 +717,11 @@ import { useVuelidate } from '@vuelidate/core' import { required, requiredIf, email, maxLength, url, helpers } from '@vuelidate/validators' import type { RecipientApplicationData } from '@/api/types' import type { Project } from '@/api/projects' -import { isTransactionInSubgraph } from '@/api/subgraph' import { formToProjectInterface } from '@/api/projects' -import { chain, showComplianceRequirement, isOptimisticRecipientRegistry } from '@/api/core' +import { chain, showComplianceRequirement } from '@/api/core' import { DateTime } from 'luxon' import { useRecipientStore, useAppStore, useUserStore } from '@/stores' -import { waitForTransactionAndCheck } from '@/utils/contracts' +import { waitForTransaction } from '@/utils/contracts' import { addRecipient as _addRecipient } from '@/api/recipient-registry' import { isValidEthAddress, resolveEns } from '@/utils/accounts' import { toReactive } from '@vueuse/core' @@ -942,11 +941,8 @@ async function addRecipient() { } const signer = await userStore.getSigner() - await waitForTransactionAndCheck( + await waitForTransaction( _addRecipient(recipientRegistryAddress.value, recipient.value, recipientRegistryInfo.value.deposit, signer), - receipt => { - return isOptimisticRecipientRegistry ? isTransactionInSubgraph(receipt) : Promise.resolve(true) - }, hash => (txHash.value = hash), ) diff --git a/vue-app/src/views/ProjectAdded.vue b/vue-app/src/views/ProjectAdded.vue index 59fe6290c..f59065d37 100644 --- a/vue-app/src/views/ProjectAdded.vue +++ b/vue-app/src/views/ProjectAdded.vue @@ -2,9 +2,9 @@
- +
- +
🎉
@@ -23,12 +23,6 @@
- - {{ $t('projectAdded.linkProjects') }} {{ $t('projectAdded.link3') }}
@@ -121,7 +115,7 @@ ul { height: calc(100vh - 113px); @media (max-width: $breakpoint-m) { padding: 2rem 0rem; - padding-bottom: 16rem; + flex-direction: column; } img { @@ -130,21 +124,21 @@ ul { right: 0; width: 66%; @media (max-width: $breakpoint-m) { + position: relative; right: 0; - width: 100%; + width: 90%; } } .content { position: relative; z-index: 1; - padding: $content-space; - width: min(100%, 512px); + width: min(80%, 512px); margin-left: 2rem; margin-top: 3rem; @media (max-width: $breakpoint-m) { - width: 100%; - margin: 0; + width: 90%; + padding: 0; } .flex-title { From 71b9fbdae26cd3cfebcda315addaa6a28dce267a Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sat, 30 Mar 2024 14:00:42 -0400 Subject: [PATCH 2/2] remove unused translation --- vue-app/src/locales/cn.json | 2 -- vue-app/src/locales/en.json | 2 -- vue-app/src/locales/es.json | 2 -- 3 files changed, 6 deletions(-) diff --git a/vue-app/src/locales/cn.json b/vue-app/src/locales/cn.json index a95b93b08..dbc945f34 100644 --- a/vue-app/src/locales/cn.json +++ b/vue-app/src/locales/cn.json @@ -730,8 +730,6 @@ "link1": "了解更多关于注册流程的信息。", "li2": "完成后,您的项目页面将上线, 我们将退还您的押金。", "li3": " 如果您的项目未通过检查,我们将退回您的押金。", - "linkProjects": "查看项目", - "link2": "查看项目", "link3": "回首页" }, "projectList": { diff --git a/vue-app/src/locales/en.json b/vue-app/src/locales/en.json index 8db5b2e14..3811acfbc 100644 --- a/vue-app/src/locales/en.json +++ b/vue-app/src/locales/en.json @@ -730,8 +730,6 @@ "link1": "learn more about the registration process here.", "li2": "Once that's complete, your project page will go live and we'll refund your deposit.", "li3": " If your project fails any checks, we'll return your deposit.", - "linkProjects": "View projects", - "link2": "View project", "link3": "Go home" }, "projectList": { diff --git a/vue-app/src/locales/es.json b/vue-app/src/locales/es.json index 704996105..ae103f13e 100644 --- a/vue-app/src/locales/es.json +++ b/vue-app/src/locales/es.json @@ -730,8 +730,6 @@ "link1": "obtener más información sobre el proceso de registro aquí.", "li2": "Una vez que se complete, la página de tu proyecto se publicará y te devolveremos tu depósito.", "li3": "Si tu proyecto no pasa alguna verificación, te devolveremos tu depósito.", - "linkProjects": "Ver proyectos", - "link2": "Ver proyecto", "link3": "Ir a inicio" }, "projectList": {