fix(mobile): handle file picker cancellation
This commit is contained in:
@@ -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, '附件'))
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user