Skip to content

Commit

Permalink
Merge pull request #6177 from owncloud/bump-tus-client-lib
Browse files Browse the repository at this point in the history
Bump tus client lib
  • Loading branch information
Pascal Wengerter authored Dec 24, 2021
2 parents 40fb5b9 + 0bef312 commit 9efaf1b
Show file tree
Hide file tree
Showing 4 changed files with 656 additions and 622 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"vue": "^2.6.10"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.16.3",
"@babel/core": "^7.16.5",
"@babel/eslint-parser": "^7.16.5",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.14.7",
"@babel/register": "^7.13.16",
"@babel/preset-env": "^7.16.5",
"@babel/register": "^7.16.5",
"@cucumber/cucumber": "^7.3.1",
"@cucumber/messages": "^17.1.1",
"@cucumber/pretty-formatter": "^1.0.0-alpha.1",
Expand Down Expand Up @@ -101,7 +101,7 @@
"rollup-plugin-copy-watch": "^0.0.1",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-gzip": "^2.5.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"postcss-url": "^9.0.0",
"query-string": "^6.8.3",
"tippy.js": "^6.3.7",
"tus-js-client": "^1.8.0",
"tus-js-client": "^2.3.0",
"uikit": "3.5.16",
"v-calendar": "^2.3.2",
"vue": "^2.6.10",
Expand Down
13 changes: 10 additions & 3 deletions packages/web-runtime/src/plugins/upload.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import tus from 'tus-js-client'
import { isSupported, Upload } from 'tus-js-client'

export default {
install(Vue) {
Vue.mixin({
computed: {
browserSupportsChunked() {
return tus.isSupported
return isSupported
}
},
methods: {
Expand All @@ -20,7 +20,7 @@ export default {
if (file.lastModified) {
mtime = file.lastModified / 1000
}
const upload = new tus.Upload(file, {
const upload = new Upload(file, {
endpoint: this.$client.files.getFileUrlV2(path),
headers: headers,
chunkSize: options.chunkSize || Infinity,
Expand Down Expand Up @@ -48,6 +48,13 @@ export default {
}
})

upload.findPreviousUploads().then((previousUploads) => {
if (previousUploads.length === 0) {
return
}
upload.resumeFromPreviousUpload(previousUploads[0])
})

upload.start()
return upload
})
Expand Down
Loading

0 comments on commit 9efaf1b

Please sign in to comment.