Add explicit axios dependency (#9179)
* Add explicit axios dependency * Adjust tsconfig comment
This commit is contained in:
parent
90f6bcbe31
commit
d3dd12d577
@ -16,6 +16,7 @@
|
||||
"type": "module",
|
||||
"version": "0.124.2-152-x",
|
||||
"dependencies": {
|
||||
"@polkadot/react-components": "^0.124.2-152-x"
|
||||
"@polkadot/react-components": "^0.124.2-152-x",
|
||||
"axios": "^1.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,8 +227,8 @@ function UploadModal ({ className, file, onClose = NOOP, onSuccess = NOOP }: Pro
|
||||
headers: { Authorization: AuthBasic },
|
||||
maxContentLength: 100 * 1024 * 1024,
|
||||
method: 'POST',
|
||||
onUploadProgress: (p: { loaded: number, total: number }) => {
|
||||
const percent = p.loaded / p.total;
|
||||
onUploadProgress: ({ loaded, total }) => {
|
||||
const percent = loaded / (total || loaded || 1);
|
||||
|
||||
setUpState({ progress: Math.round(percent * 99), up: true });
|
||||
},
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import spinnerSrc from './Spinner.png';
|
||||
import spinnerSrc from './Spinner.png.js';
|
||||
import { styled } from './styled.js';
|
||||
import { useTranslation } from './translate.js';
|
||||
|
||||
|
||||
@ -9,12 +9,6 @@ import { LANGUAGE_DEFAULT, settings } from '@polkadot/ui-settings';
|
||||
|
||||
import Backend from './Backend.js';
|
||||
|
||||
interface Services {
|
||||
languageDetector: {
|
||||
detect: () => string;
|
||||
};
|
||||
}
|
||||
|
||||
const languageDetector = new LanguageDetector();
|
||||
|
||||
languageDetector.addDetector({
|
||||
@ -91,10 +85,13 @@ i18next
|
||||
);
|
||||
|
||||
settings.on('change', (settings): void => {
|
||||
i18next.changeLanguage(
|
||||
(
|
||||
settings.i18nLang === LANGUAGE_DEFAULT
|
||||
? (i18next.services as Services).languageDetector.detect()
|
||||
: settings.i18nLang
|
||||
// If we want to use the default language, we need to pass no
|
||||
// actual param through here
|
||||
// https://github.com/i18next/i18next/blob/21eac5a605601ec1067aac3583c6ec6bc2ecd3b7/src/i18next.js#L366
|
||||
? i18next.changeLanguage()
|
||||
: i18next.changeLanguage(settings.i18nLang)
|
||||
).catch(console.error);
|
||||
});
|
||||
|
||||
|
||||
@ -9,7 +9,9 @@ const process = require('process');
|
||||
const PKG_FIX = [
|
||||
'@frequency-chain/api-augment',
|
||||
// we use the ESM path here
|
||||
'chartjs-plugin-annotation'
|
||||
'chartjs-plugin-annotation',
|
||||
// the default export here is ESM
|
||||
'i18next-browser-languagedetector'
|
||||
];
|
||||
|
||||
PKG_FIX.forEach((f) => {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"lib": ["es2021", "dom"],
|
||||
"jsx": "react",
|
||||
"resolveJsonModule": true,
|
||||
/* FIXME i18next-browser-languagedetector & axios is problematic with nodenext resolution */
|
||||
/* FIXME we still have some issues with some deps that make the default nodenext impossible */
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@polkadot/apps": ["apps/src/index.tsx"],
|
||||
|
||||
29
yarn.lock
29
yarn.lock
@ -1486,6 +1486,7 @@ __metadata:
|
||||
resolution: "@polkadot/app-files@workspace:packages/page-files"
|
||||
dependencies:
|
||||
"@polkadot/react-components": ^0.124.2-152-x
|
||||
axios: ^1.3.4
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@ -4801,6 +4802,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"axios@npm:^1.3.4":
|
||||
version: 1.3.4
|
||||
resolution: "axios@npm:1.3.4"
|
||||
dependencies:
|
||||
follow-redirects: ^1.15.0
|
||||
form-data: ^4.0.0
|
||||
proxy-from-env: ^1.1.0
|
||||
checksum: 7440edefcf8498bc3cdf39de00443e8101f249972c83b739c6e880d9d669fea9486372dbe8739e88b3bf8bb1ad15f6106693f206f078f4516fe8fd47b1c3093c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"babel-plugin-styled-components@npm:>= 1.12.0":
|
||||
version: 2.0.7
|
||||
resolution: "babel-plugin-styled-components@npm:2.0.7"
|
||||
@ -8827,6 +8839,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"follow-redirects@npm:^1.15.0":
|
||||
version: 1.15.2
|
||||
resolution: "follow-redirects@npm:1.15.2"
|
||||
peerDependenciesMeta:
|
||||
debug:
|
||||
optional: true
|
||||
checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"foreach@npm:^2.0.5":
|
||||
version: 2.0.5
|
||||
resolution: "foreach@npm:2.0.5"
|
||||
@ -14098,6 +14120,13 @@ fsevents@~2.3.2:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"proxy-from-env@npm:^1.1.0":
|
||||
version: 1.1.0
|
||||
resolution: "proxy-from-env@npm:1.1.0"
|
||||
checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"psl@npm:^1.1.28, psl@npm:^1.1.33":
|
||||
version: 1.8.0
|
||||
resolution: "psl@npm:1.8.0"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user