TF-2245 Fix upload attachment when token expired on web
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 0b2ab3c6ff4213bccc064822e640cc40592a39e8)
This commit is contained in:
@@ -40,15 +40,18 @@ class DownloadClient {
|
||||
String fileExtension,
|
||||
String fileName,
|
||||
{
|
||||
Uint8List? bytesData,
|
||||
String? filePath,
|
||||
double? maxWidth,
|
||||
bool? compress,
|
||||
}
|
||||
) async {
|
||||
try {
|
||||
if (bytesData == null) {
|
||||
Uint8List? bytesData;
|
||||
if (filePath == null || filePath.isEmpty) {
|
||||
log('DownloadClient::downloadImageAsBase64(): bytesData is NULL');
|
||||
bytesData = await _dioClient.get(url, options: Options(responseType: ResponseType.bytes));
|
||||
} else {
|
||||
bytesData = await File(filePath).readAsBytes();
|
||||
}
|
||||
|
||||
if (bytesData == null) {
|
||||
|
||||
Reference in New Issue
Block a user