Skip to content

Commit

Permalink
Fix drop folder type (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored Feb 22, 2025
1 parent 650680b commit 172b634
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/Dialogs/ImportFolderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { ImportFolderType } from '@/core/types/api/import-folder';

const defaultImportFolder = {
WatchForNewFiles: false,
DropFolderType: 'Excluded',
DropFolderType: 'None',
Path: '',
Name: '',
ID: 0,
Expand Down Expand Up @@ -127,11 +127,11 @@ function ImportFolderModal() {
<Select
label="Drop Type"
id="DropFolderType"
value={importFolder.DropFolderType ?? 'Excluded'}
value={importFolder.DropFolderType ?? 'None'}
onChange={handleInputChange}
className="w-full"
>
<option value="Excluded">None</option>
<option value="None">None</option>
<option value="Source">Source</option>
<option value="Destination">Destination</option>
<option value="Both">Both</option>
Expand Down
2 changes: 1 addition & 1 deletion src/core/types/api/import-folder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type ImportFolderType = {
ID: number;
WatchForNewFiles?: boolean;
DropFolderType?: 'Excluded' | 'Source' | 'Destination' | 'Both';
DropFolderType?: 'None' | 'Source' | 'Destination' | 'Both';
Path: string;
Name: string;
Size?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/panels/ImportFolders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ImportFolders() {
let flags = '';

if (folder.DropFolderType === 'Both') flags = 'Source, Destination';
else if (folder.DropFolderType !== 'Excluded') flags = folder.DropFolderType ?? '';
else if (folder.DropFolderType !== 'None') flags = folder.DropFolderType ?? '';

if (folder.WatchForNewFiles) flags += folder.DropFolderType ? ', Watch' : 'Watch';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/firstrun/ImportFolders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Folder = (props: ImportFolderType) => {
let tempFlags = '';

if (DropFolderType === 'Both') tempFlags = 'Source, Destination';
else if (DropFolderType !== 'Excluded') tempFlags = DropFolderType ?? '';
else if (DropFolderType !== 'None') tempFlags = DropFolderType ?? '';

if (WatchForNewFiles) tempFlags += DropFolderType ? ', Watch' : 'Watch';

Expand Down

0 comments on commit 172b634

Please sign in to comment.