You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
758 B
TypeScript
36 lines
758 B
TypeScript
3 years ago
|
import {Component} from '@angular/core';
|
||
3 years ago
|
import {File} from "../../../models/File";
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-import-tab',
|
||
|
templateUrl: './import-tab.component.html',
|
||
|
styleUrls: ['./import-tab.component.scss']
|
||
|
})
|
||
3 years ago
|
export class ImportTabComponent {
|
||
3 years ago
|
|
||
|
public files: File[] = [];
|
||
3 years ago
|
|
||
3 years ago
|
constructor() {
|
||
3 years ago
|
}
|
||
3 years ago
|
|
||
3 years ago
|
/**
|
||
|
* Adds an imported file to the list of imported files
|
||
|
* @param {File} file
|
||
|
* @returns {Promise<void>}
|
||
|
*/
|
||
|
public async addFileFromImport(file: File) {
|
||
3 years ago
|
this.files.push(file);
|
||
3 years ago
|
if (this.files.length % 50 === 0) { // refresh every 50 pictures
|
||
|
this.refreshFileView();
|
||
|
}
|
||
3 years ago
|
}
|
||
|
|
||
3 years ago
|
/**
|
||
|
* Refreshes the file view
|
||
|
* @returns {Promise<void>}
|
||
|
*/
|
||
|
public refreshFileView() {
|
||
|
this.files = [...this.files];
|
||
|
}
|
||
3 years ago
|
}
|