use nanoid instead of shortid
This commit is contained in:
parent
0624251677
commit
46ed1e42d4
|
@ -43,6 +43,7 @@
|
|||
"http-status-codes": "^2.1.4",
|
||||
"jsonp": "^0.2.1",
|
||||
"ms": "^2.1.2",
|
||||
"nanoid": "^3.1.23",
|
||||
"normalize.css": "^8.0.1",
|
||||
"path-browserify": "^1.0.1",
|
||||
"polished": "^4.1.3",
|
||||
|
@ -58,7 +59,6 @@
|
|||
"react-svg-loader": "^3.0.3",
|
||||
"react-syntax-highlighter": "^15.4.4",
|
||||
"react-use": "^17.2.4",
|
||||
"shortid": "^2.2.16",
|
||||
"skynet-js": "^4.0.11-beta",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"swr": "^0.5.6",
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Add, Cloud, Unlock, Info } from "../Icons";
|
|||
import classNames from "classnames";
|
||||
import path from "path-browserify";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import shortid from "shortid";
|
||||
import { nanoid } from "nanoid";
|
||||
import useAuthenticatedStatus from "../../services/useAuthenticatedStatus";
|
||||
import Link from "../Link";
|
||||
import UploaderElement from "./UploaderElement";
|
||||
|
@ -51,10 +51,7 @@ const Uploader = () => {
|
|||
files = [{ name, files }];
|
||||
}
|
||||
|
||||
setUploads((uploads) => [
|
||||
...files.map((file) => ({ id: shortid.generate(), file, mode, status: "enqueued" })),
|
||||
...uploads,
|
||||
]);
|
||||
setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]);
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
|
@ -10335,11 +10335,6 @@ nano-css@^5.3.1:
|
|||
stacktrace-js "^2.0.2"
|
||||
stylis "^4.0.6"
|
||||
|
||||
nanoid@^2.1.0:
|
||||
version "2.1.11"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
|
||||
integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==
|
||||
|
||||
nanoid@^3.1.23:
|
||||
version "3.1.23"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81"
|
||||
|
@ -13250,13 +13245,6 @@ short-uuid@^4.1.0:
|
|||
any-base "^1.1.0"
|
||||
uuid "^8.3.2"
|
||||
|
||||
shortid@^2.2.16:
|
||||
version "2.2.16"
|
||||
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608"
|
||||
integrity sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==
|
||||
dependencies:
|
||||
nanoid "^2.1.0"
|
||||
|
||||
side-channel@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
|
||||
|
|
Reference in New Issue