|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import {Component} from '@angular/core';
|
|
|
|
|
import {File} from "../../../models/File";
|
|
|
|
|
import {FileService} from "../../../services/file/file.service";
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-import-tab',
|
|
|
|
@ -10,11 +11,26 @@ export class ImportTabComponent {
|
|
|
|
|
|
|
|
|
|
public files: File[] = [];
|
|
|
|
|
|
|
|
|
|
constructor() { }
|
|
|
|
|
constructor(private fileService: FileService) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public addFileFromImport(file: File) {
|
|
|
|
|
/**
|
|
|
|
|
* Adds an imported file to the list of imported files
|
|
|
|
|
* @param {File} file
|
|
|
|
|
* @returns {Promise<void>}
|
|
|
|
|
*/
|
|
|
|
|
public async addFileFromImport(file: File) {
|
|
|
|
|
this.files.push(file);
|
|
|
|
|
this.files = [...this.files];
|
|
|
|
|
if (this.files.length % 50 === 0) { // refresh every 50 pictures
|
|
|
|
|
this.refreshFileView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Refreshes the file view
|
|
|
|
|
* @returns {Promise<void>}
|
|
|
|
|
*/
|
|
|
|
|
public refreshFileView() {
|
|
|
|
|
this.files = [...this.files];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|