Merge remote-tracking branch 'origin/master' into ivo/inc_body_restore
This commit is contained in:
commit
f6ea612126
|
@ -0,0 +1,2 @@
|
||||||
|
- fixed uploaded directory name (was "undefined" before)
|
||||||
|
- fixed empty directory upload progress (size was not calculated for directories)
|
|
@ -25,7 +25,7 @@
|
||||||
"gatsby-plugin-postcss": "^4.14.0",
|
"gatsby-plugin-postcss": "^4.14.0",
|
||||||
"gatsby-plugin-purgecss": "^6.1.0",
|
"gatsby-plugin-purgecss": "^6.1.0",
|
||||||
"gatsby-plugin-react-helmet": "^4.14.0",
|
"gatsby-plugin-react-helmet": "^4.14.0",
|
||||||
"gatsby-plugin-robots-txt": "^1.6.13",
|
"gatsby-plugin-robots-txt": "^1.6.14",
|
||||||
"gatsby-plugin-sharp": "^4.0.1",
|
"gatsby-plugin-sharp": "^4.0.1",
|
||||||
"gatsby-plugin-svgr": "^3.0.0-beta.0",
|
"gatsby-plugin-svgr": "^3.0.0-beta.0",
|
||||||
"gatsby-remark-classes": "^1.0.2",
|
"gatsby-remark-classes": "^1.0.2",
|
||||||
|
|
|
@ -47,8 +47,9 @@ const Uploader = () => {
|
||||||
const handleDrop = async (files) => {
|
const handleDrop = async (files) => {
|
||||||
if (mode === "directory" && files.length) {
|
if (mode === "directory" && files.length) {
|
||||||
const name = getRootDirectory(files[0]); // get the file path from the first file
|
const name = getRootDirectory(files[0]); // get the file path from the first file
|
||||||
|
const size = files.reduce((acc, file) => acc + file.size, 0);
|
||||||
|
|
||||||
files = [{ name, files }];
|
files = [{ name, size, files }];
|
||||||
}
|
}
|
||||||
|
|
||||||
setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]);
|
setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]);
|
||||||
|
|
|
@ -85,7 +85,7 @@ export default function UploaderElement({ onUploadStateChange, upload }) {
|
||||||
if (upload.mode === "directory") {
|
if (upload.mode === "directory") {
|
||||||
const files = upload.file.files;
|
const files = upload.file.files;
|
||||||
const directory = files.reduce((acc, file) => ({ ...acc, [getRelativeFilePath(file)]: file }), {});
|
const directory = files.reduce((acc, file) => ({ ...acc, [getRelativeFilePath(file)]: file }), {});
|
||||||
const name = encodeURIComponent(upload.name);
|
const name = encodeURIComponent(upload.file.name);
|
||||||
|
|
||||||
response = await client.uploadDirectory(directory, name, { onUploadProgress });
|
response = await client.uploadDirectory(directory, name, { onUploadProgress });
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -6175,12 +6175,12 @@ gatsby-plugin-react-helmet@^4.14.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime" "^7.15.4"
|
"@babel/runtime" "^7.15.4"
|
||||||
|
|
||||||
gatsby-plugin-robots-txt@^1.6.13:
|
gatsby-plugin-robots-txt@^1.6.14:
|
||||||
version "1.6.13"
|
version "1.6.14"
|
||||||
resolved "https://registry.yarnpkg.com/gatsby-plugin-robots-txt/-/gatsby-plugin-robots-txt-1.6.13.tgz#01e1ce68e3f4e07f957ac9a20cd2a9e12fdd3f79"
|
resolved "https://registry.yarnpkg.com/gatsby-plugin-robots-txt/-/gatsby-plugin-robots-txt-1.6.14.tgz#e7ce50b137fecc81c1ac384ddc544a4bafd8da89"
|
||||||
integrity sha512-MUPJsvkALwSmfRb1L3IVNmzIqwV35fol1RVot425ZYXvtD+s0OtZli5VnhLNxsX0beodyavzFl0SRJCCQZz0/g==
|
integrity sha512-5NLdgKPw7xHjvowNDU5aWzl/g3M3WU0Equn73aXGGdEue9Nuq7zh/Lh3oX+OM+MZolRCiM9GNHxdIvYPDWNXgA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime" "^7.14.0"
|
"@babel/runtime" "^7.15.4"
|
||||||
generate-robotstxt "^8.0.3"
|
generate-robotstxt "^8.0.3"
|
||||||
|
|
||||||
gatsby-plugin-sharp@^4.0.1:
|
gatsby-plugin-sharp@^4.0.1:
|
||||||
|
|
Reference in New Issue