Browse Source

优化重复文件逻辑

John 1 năm trước cách đây
mục cha
commit
831f02aa71
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 1 0
      src/pages/DuplicateFile/FilesManage.tsx
  2. 2 2
      src/services/file-service.ts

+ 1 - 0
src/pages/DuplicateFile/FilesManage.tsx

@@ -147,6 +147,7 @@ export default function FilesManage() {
     setRemoveList([]);
     const [isError, searchDuplicateFileRes] = await searchDuplicateFile({
       sourceId: `${fileId}`,
+      type: ''
     });
     if (!isError) {
       typeof searchDuplicateFileRes === "string" &&

+ 2 - 2
src/services/file-service.ts

@@ -319,10 +319,10 @@ type SearchResult = [boolean, DuplicateFileInfo[] | string | unknown];
 
 export async function searchDuplicateFile({
   sourceId,
-  type
+  type = ''
 }: {
   sourceId: string;
-  type: string
+  type?: string
 }): Promise<any> {
   try {
     const DB = await Database.load(`sqlite:files_${sourceId}.db`);