Merge pull request #602 from NebulousLabs/skynet-js-3.0.0
Update skynet-js to version 3.0.0
This commit is contained in:
commit
1a4320d149
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 });
|
||||
|
|
Reference in New Issue