TF-2245 Only use bytes when insert image in identity creator on web
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit d879dbaf7e9fbe81c7cf1c1e43b1ec275e3522c6)
This commit is contained in:
@@ -478,12 +478,12 @@ class IdentityCreatorController extends BaseController {
|
||||
|
||||
final filePickerResult = await FilePicker.platform.pickFiles(
|
||||
type: FileType.image,
|
||||
withData: true
|
||||
withData: PlatformInfo.isWeb
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
final platformFile = filePickerResult?.files.single;
|
||||
if (platformFile != null) {
|
||||
if (filePickerResult?.files.isNotEmpty == true) {
|
||||
final platformFile = filePickerResult!.files.first;
|
||||
_insertInlineImage(context, platformFile, maxWidth: maxWidth);
|
||||
} else {
|
||||
_appToast.showToastErrorMessage(
|
||||
@@ -515,7 +515,7 @@ class IdentityCreatorController extends BaseController {
|
||||
if (PlatformInfo.isWeb) {
|
||||
richTextWebController.insertImageAsBase64(platformFile: platformFile);
|
||||
} else if (PlatformInfo.isMobile) {
|
||||
richTextMobileTabletController.insertImageAsBase64(platformFile: platformFile, maxWidth: maxWidth);
|
||||
richTextMobileTabletController.insertImageData(platformFile: platformFile, maxWidth: maxWidth);
|
||||
} else {
|
||||
logError("IdentityCreatorController::_insertInlineImage: Platform not supported");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user