Update skynet-js to version 3.0.0

This commit is contained in:
Marcin S 2021-01-26 16:47:49 +01:00
parent 8e0160bfb7
commit a8aa53ddd6
No known key found for this signature in database
GPG Key ID: 68A476F4791BB6B3
4 changed files with 1119 additions and 2170 deletions

View File

@ -31,7 +31,7 @@
"react-mailchimp-subscribe": "2.1.0",
"react-syntax-highlighter": "15.4.3",
"react-visibility-sensor": "5.1.1",
"skynet-js": "2.4.0"
"skynet-js": "3.0.0"
},
"devDependencies": {
"cypress": "6.3.0",

View File

@ -14,7 +14,7 @@ const client = new SkynetClient();
async function example() {
try {
// upload
const skylink = await client.uploadFile(file);
const { skylink } = await client.uploadFile(file);
console.log(\`Upload successful, skylink: \${skylink}\`);
// download

View File

@ -130,7 +130,7 @@ export default function HomeUpload() {
response = await client.uploadFile(file, { onUploadProgress });
}
onFileStateChange(file, { status: "complete", url: client.getSkylinkUrl(response) });
onFileStateChange(file, { status: "complete", url: client.getSkylinkUrl(response.skylink) });
} catch (error) {
if (error.response && error.response.status === StatusCodes.TOO_MANY_REQUESTS) {
onFileStateChange(file, { progress: -1 });

3283
yarn.lock

File diff suppressed because it is too large Load Diff