fix(mobile): handle file picker cancellation
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
CaseUploadResponse
|
||||
} from '@/types/api';
|
||||
import { apiRequest, apiUrl, authHeaders, authenticatedFileUrl, readTextPayload } from './api';
|
||||
import { fileSelectionFailure } from '../utils/file-selection';
|
||||
|
||||
const audioExtensions = ['.mp3', '.wav', '.m4a', '.webm', '.aac', '.ogg'];
|
||||
|
||||
@@ -31,7 +32,7 @@ export const chooseCaseAudio = () =>
|
||||
size: Number(file.size || 0)
|
||||
});
|
||||
},
|
||||
fail: () => reject(new Error('未选择音频'))
|
||||
fail: (error) => reject(fileSelectionFailure(error, '音频'))
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user