File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
libraries/react-shared-libraries/src/helpers Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
4848 telegramBotName = { process . env . TELEGRAM_BOT_NAME ! }
4949 neynarClientId = { process . env . NEYNAR_CLIENT_ID ! }
5050 isSecured = { ! process . env . NOT_SECURED }
51+ disableImageCompression = { ! ! process . env . DISABLE_IMAGE_COMPRESSION }
5152 >
5253 < ToltScript />
5354 < FacebookComponent />
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ export function useUppyUploader(props: {
6363 onUploadSuccess : ( result : UploadResult ) => void ;
6464 allowedFileTypes : string ;
6565} ) {
66- const { storageProvider, backendUrl } = useVariables ( ) ;
66+ const { storageProvider, backendUrl, disableImageCompression } =
67+ useVariables ( ) ;
6768 const { onUploadSuccess, allowedFileTypes } = props ;
6869 const fetch = useFetch ( ) ;
6970
@@ -83,12 +84,14 @@ export function useUppyUploader(props: {
8384 backendUrl
8485 ) ;
8586 uppy2 . use ( plugin , options ) ;
86- uppy2 . use ( Compressor , {
87- convertTypes : [ 'image/jpeg' ] ,
88- maxWidth : 1000 ,
89- maxHeight : 1000 ,
90- quality : 1 ,
91- } ) ;
87+ if ( ! disableImageCompression ) {
88+ uppy2 . use ( Compressor , {
89+ convertTypes : [ 'image/jpeg' ] ,
90+ maxWidth : 1000 ,
91+ maxHeight : 1000 ,
92+ quality : 1 ,
93+ } ) ;
94+ }
9295 // Set additional metadata when a file is added
9396 uppy2 . on ( 'file-added' , ( file ) => {
9497 uppy2 . setFileMeta ( file . id , {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ interface VariableContextInterface {
1818 telegramBotName : string ;
1919 neynarClientId : string ;
2020 isSecured : boolean ;
21+ disableImageCompression : boolean ;
2122 tolt : string ;
2223}
2324const VariableContext = createContext ( {
@@ -36,6 +37,7 @@ const VariableContext = createContext({
3637 telegramBotName : '' ,
3738 facebookPixel : '' ,
3839 neynarClientId : '' ,
40+ disableImageCompression : false ,
3941 tolt : '' ,
4042} as VariableContextInterface ) ;
4143
You can’t perform that action at this time.
0 commit comments