fix(mobile): handle file picker cancellation

This commit is contained in:
key
2026-07-29 02:01:45 +08:00
parent fd59421574
commit cb928edafd
18 changed files with 202 additions and 26 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ import type {
} from '@/types/api';
import { apiRequest, apiUrl, authHeaders, readTextPayload } from './api';
import { getSelectedPosition } from './auth';
import { fileSelectionFailure } from '../utils/file-selection';
type RawKnowledgeSnippet = KnowledgeSnippet & {
title?: string;
@@ -44,7 +45,7 @@ export const chooseKnowledgeMedia = () =>
}
resolve({ path, name, size, kind });
},
fail: () => reject(new Error('未选择附件'))
fail: (error) => reject(fileSelectionFailure(error, '附件'))
});
});