Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release - v1.1.5 #169

Merged
merged 6 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const formats = [{
// to be loaded with ES Module compatible loader
name: 'browser-es',
bundleExternals: true,
minifyResult: true,
minifyResult: false,
entryPoints: ['lib/mega.mjs'],
bundleFormat: 'esm',
platform: 'browser',
Expand Down
5 changes: 4 additions & 1 deletion lib/mutable-file.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ class MutableFile extends File {
const sendChunk = () => {
const chunkPosition = position
const chunkBuffer = uploadBuffer
let bytesUploaded = 0
let tries = 0

const trySendChunk = () => {
Expand All @@ -374,6 +375,9 @@ class MutableFile extends File {
}
return response.arrayBuffer()
}).then(hash => {
bytesUploaded += chunkBuffer.length
stream.emit('progress', { bytesLoaded: sizeCheck, bytesUploaded, bytesTotal: size })

const hashBuffer = Buffer.from(hash)
if (hashBuffer.length > 0) {
source.end()
Expand Down Expand Up @@ -412,7 +416,6 @@ class MutableFile extends File {
break
}
sizeCheck += data.length
stream.emit('progress', { bytesLoaded: sizeCheck, bytesTotal: size })

data.copy(uploadBuffer, chunkPos)
chunkPos += data.length
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Unofficial JavaScript SDK for MEGA

> **Project status:**
> Development stalled. [Issue and discussion requesting locked only to supporters](https://github.com/qgustavor/mega/discussions/138). Looking for someone to lead this project as, me, qgustavor, I don't want to continue leading this project. As an example, I accepted [this PR](https://github.com/qgustavor/megajs-docs/pull/6) just because **at least** someone wanted to help! On the other hand it made the home page uglier! Why adding a `npm install` and `import` instructions in the home page?! Come on! [It's already in the tutorial](https://mega.js.org/docs/1.0/tutorial/install)! Focus on the library main points in the home page instead! [React](https://react.dev/) does not have a `npm install` in the homepage, neither [Vue](https://vuejs.org/), nor [Angular](https://angular.io/). [Svelte](https://svelte.dev/) does but it's below the fold, after showing the main points of the library!
>
> I don't care anymore! If someone wants to lead this project then make a fork, show that you really care about this project and I will let you to lead this project. You don't need to maintain the fork like me after tonistiigi, I will transfer the project to you.

**API documentation and examples are available in the website: [https://mega.js.org/](https://mega.js.org/)**

* This is based on [tonistiigi's mega library](https://github.com/tonistiigi/mega).
Expand Down
Loading