Rename imported attribute

This commit is contained in:
Vishnu Mohandas 2021-04-23 13:19:49 +05:30
parent c6ba6f151a
commit aae606f001
2 changed files with 7 additions and 8 deletions

View file

@ -1,9 +1,9 @@
import React from 'react';
import { collection } from 'services/collectionService';
import { Collection } from 'services/collectionService';
import styled from 'styled-components';
interface CollectionProps {
collections: collection[];
collections: Collection[];
selected?: number;
selectCollection: (id?: number) => void;
}

View file

@ -1,5 +1,5 @@
import { runningInBrowser } from 'utils/common';
import { collection } from './collectionService';
import { Collection } from './collectionService';
import downloadManager from './downloadManager';
import { file } from './fileService';
@ -14,7 +14,7 @@ class ExportService {
exportInProgress: Promise<void> = null;
abortExport: boolean = false;
async exportFiles(files: file[], collections: collection[]) {
async exportFiles(files: file[], collections: Collection[]) {
if (this.exportInProgress) {
this.ElectronAPIs.sendNotification(ExportNotification.IN_PROGRESS);
return this.exportInProgress;
@ -22,7 +22,7 @@ class ExportService {
this.exportInProgress = this.fileExporter(files, collections);
return this.exportInProgress;
}
async fileExporter(files: file[], collections: collection[]) {
async fileExporter(files: file[], collections: Collection[]) {
try {
const dir = await this.ElectronAPIs.selectRootDirectory();
if (!dir) {
@ -38,9 +38,8 @@ class ExportService {
);
const collectionIDMap = new Map<number, string>();
for (let collection of collections) {
let collectionFolderPath = `${dir}/${
collection.id
}_${this.sanitizeName(collection.name)}`;
let collectionFolderPath = `${dir}/${collection.id
}_${this.sanitizeName(collection.name)}`;
await this.ElectronAPIs.checkExistsAndCreateCollectionDir(
collectionFolderPath
);