Merge pull request #602 from NebulousLabs/skynet-js-3.0.0

Update skynet-js to version 3.0.0
This commit is contained in:
Karol Wypchło 2021-01-28 13:20:07 +01:00 committed by GitHub
commit 1a4320d149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1119 additions and 2170 deletions

View File

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

View File

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

View File

@ -130,7 +130,7 @@ export default function HomeUpload() {
response = await client.uploadFile(file, { onUploadProgress }); 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) { } catch (error) {
if (error.response && error.response.status === StatusCodes.TOO_MANY_REQUESTS) { if (error.response && error.response.status === StatusCodes.TOO_MANY_REQUESTS) {
onFileStateChange(file, { progress: -1 }); onFileStateChange(file, { progress: -1 });

3283
yarn.lock

File diff suppressed because it is too large Load Diff