Skip to content

Commit

Permalink
docs(files): add jsdoc to progress
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg committed Apr 6, 2022
1 parent 8f33cb6 commit 41607c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions components/views/files/controls/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ export default Vue.extend({
this.errors.push(this.$t('errors.chat.contains_nsfw') as string)
}
},
/**
* @method setProgress
* @description set progress (% out of 100) while file is being pushed to textile bucket. passed as a callback
* @param num current progress in bytes
* @param size total file size in bytes
*/
setProgress(num: number, size: number) {
this.progress = Math.floor((num / size) * 100)
},
Expand Down
2 changes: 1 addition & 1 deletion libraries/Files/TextileFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TextileFileSystem extends FilSystem {
* @description Upload file to the bucket and create in the file system afterwards
* use uuid as bucket path so files can be renamed freely
* @param {File} file file to be uploaded
* @param {Function} progressCallback used to show progress meter in componment that calls this method
* @param {Function} progressCallback used to show progress meter in componment Controls.vue
*/
async uploadFile(file: File, progressCallback: Function) {
const id = uuidv4()
Expand Down
2 changes: 1 addition & 1 deletion libraries/Files/remote/textile/Bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class Bucket extends RFM implements RFMInterface {
* @method pushFile
* @description Add file to bucket
* @param {File} file file to be uploaded
* @param {Function} progressCallback used to show progress meter in componment that calls this method
* @param {Function} progressCallback used to show progress meter in componment Controls.vue
* @returns Promise whether it was uploaded or not
*/
async pushFile(
Expand Down

0 comments on commit 41607c4

Please sign in to comment.