Skip to content

Commit

Permalink
chore: extract map to helper folder
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanVicens committed Mar 1, 2024
1 parent 327786e commit 9c9f588
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { VirtualDriveError } from '../../../../shared/issues/VirtualDriveError';
import { TrackedActions } from '../../../shared/IPC/events/sync-engine';

export const virtualDriveErrorToTrackedActionsMap = new Map<
VirtualDriveError,
TrackedActions
>([
['UPLOAD_ERROR', 'Upload Error'],
['DOWNLOAD_ERROR', 'Download Error'],
['RENAME_ERROR', 'Rename Error'],
['DELETE_ERROR', 'Delete Error'],
// FOLDERS
['FOLDER_RENAME_ERROR', 'Rename Error'],
['FOLDER_CREATE_ERROR', 'Upload Error'],
]);
19 changes: 2 additions & 17 deletions src/apps/main/analytics/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,9 @@ import {
TrackedActions,
ErrorContext,
} from '../../shared/IPC/events/sync-engine';
import {
VirtualDriveError,
isVirtualDriveFolderError,
} from '../../../shared/issues/VirtualDriveError';
import { isVirtualDriveFolderError } from '../../../shared/issues/VirtualDriveError';
import { VirtualDriveIssue } from '../../../shared/issues/VirtualDriveIssue';

const virtualDriveErrorToTrackedActionsMap = new Map<
VirtualDriveError,
TrackedActions
>([
['UPLOAD_ERROR', 'Upload Error'],
['DOWNLOAD_ERROR', 'Download Error'],
['RENAME_ERROR', 'Rename Error'],
['DELETE_ERROR', 'Delete Error'],
// FOLDERS
['FOLDER_RENAME_ERROR', 'Rename Error'],
['FOLDER_CREATE_ERROR', 'Upload Error'],
]);
import { virtualDriveErrorToTrackedActionsMap } from './helpers/virtualDriveErrorToTrackedActionsMap';

function platformShortName(platform: string) {
switch (platform) {
Expand Down

0 comments on commit 9c9f588

Please sign in to comment.