MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / append

Method append

frontend/src/services/uploadService.ts:280–301  ·  view source on GitHub ↗
(
    file: File,
    url: string,
    password: string,
    options: UploadOptions,
    // eslint-disable-next-line no-unused-vars
    beforeMounted?: (uploadFile: UploadFiles) => void
  )

Source from the content-addressed store, hash-verified

278 });
279
280 append(
281 file: File,
282 url: string,
283 password: string,
284 options: UploadOptions,
285 // eslint-disable-next-line no-unused-vars
286 beforeMounted?: (uploadFile: UploadFiles) => void
287 ) {
288 const tempId = Date.now().toString();
289 const uploadFile = new UploadFiles(tempId, file, url, password, options);
290 if (beforeMounted) {
291 beforeMounted(uploadFile);
292 }
293 this.files.set(tempId, uploadFile);
294 if (this.status == "stopped") {
295 this.status = "working";
296 this.current = tempId;
297 uploadFile.onStart();
298 }
299 this.update();
300 return uploadFile;
301 }
302
303 changeId(oldId: string, newId: string) {
304 if (this.files.get(newId)) {

Callers 4

fileSumFunction · 0.45
startMethod · 0.45
selectedFilesFunction · 0.45
startUploadFunction · 0.45

Calls 3

onStartMethod · 0.95
updateMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected