From 89507cd037616fe7b3308b9fc4af0be58240c4ea Mon Sep 17 00:00:00 2001 From: PhilReact Date: Wed, 4 Jun 2025 14:33:58 +0300 Subject: [PATCH] change support text and link --- src/components/NewUsersCTA.tsx | 9 ++--- src/constants/constants.ts | 3 ++ src/i18n/locales/de/core.json | 2 +- src/i18n/locales/de/question.json | 4 ++- src/i18n/locales/en/core.json | 2 +- src/i18n/locales/en/question.json | 4 ++- src/i18n/locales/es/core.json | 2 +- src/i18n/locales/es/question.json | 4 ++- src/i18n/locales/fr/core.json | 2 +- src/i18n/locales/fr/question.json | 4 ++- src/i18n/locales/it/core.json | 2 +- src/i18n/locales/it/question.json | 4 ++- src/i18n/locales/ja/core.json | 2 +- src/i18n/locales/ja/question.json | 4 ++- src/i18n/locales/ru/core.json | 2 +- src/i18n/locales/ru/question.json | 4 ++- src/i18n/locales/zh/core.json | 2 +- src/i18n/locales/zh/question.json | 4 ++- src/qortal/get.ts | 57 ++++++++++++++++++++++++++++++- 19 files changed, 94 insertions(+), 23 deletions(-) diff --git a/src/components/NewUsersCTA.tsx b/src/components/NewUsersCTA.tsx index d444717..0618ce5 100644 --- a/src/components/NewUsersCTA.tsx +++ b/src/components/NewUsersCTA.tsx @@ -70,17 +70,14 @@ export const NewUsersCTA = ({ balance }) => { onClick={() => { if (window?.electronAPI?.openExternal) { window.electronAPI.openExternal( - 'https://link.qortal.dev/telegram-invite' + 'https://link.qortal.dev/support' ); } else { - window.open( - 'https://link.qortal.dev/telegram-invite', - '_blank' - ); + window.open('https://link.qortal.dev/support', '_blank'); } }} > - Telegram + Nextcloud MAX_SIZE_PUBLISH) { + throw new Error( + i18n.t('question:message.error.max_size_publish', { + size: 2, + postProcess: 'capitalizeFirstChar', + }) + ); + } + + if (file && file.size > MAX_SIZE_PUBLIC_NODE) { + const isPublicNode = await isRunningGateway(); + if (isPublicNode) { + throw new Error( + i18n.t('question:message.error.max_size_publish_public', { + size: 500, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + // Fill tags dynamically while maintaining backward compatibility for (let i = 0; i < 5; i++) { result[`tag${i + 1}`] = tags[i] || data[`tag${i + 1}`] || undefined; @@ -1542,6 +1567,36 @@ export const publishMultipleQDNResources = async ( }) ); } + const isPublicNode = await isRunningGateway(); + if (isPublicNode) { + const hasOversizedFilePublicNode = resources.some((resource) => { + const file = resource?.file; + return file instanceof File && file.size > MAX_SIZE_PUBLIC_NODE; + }); + + if (hasOversizedFilePublicNode) { + throw new Error( + i18n.t('question:message.error.max_size_publish_public', { + size: 500, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + const hasOversizedFile = resources.some((resource) => { + const file = resource?.file; + return file instanceof File && file.size > MAX_SIZE_PUBLISH; + }); + + if (hasOversizedFile) { + throw new Error( + i18n.t('question:message.error.max_size_publish', { + size: 2, + postProcess: 'capitalizeFirstChar', + }) + ); + } const encrypt = data?.encrypt;